+2003-01-25 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
+
+ PR optimization/9279
+
+ Merge from mainline:
+
+ 2002-07-10 Roger Sayle <roger@eyesopen.com>
+
+ PR c/2454
+ * combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply
+ to SUBREGs of MEMs. (num_sign_bit_copies): Likewise.
+
2003-01-25 Jan Hubicka <jh@suse.cz>
PR fortran/9258
- * global.c (struct allocno): Add no_stack_reg.
- (global_conflicts): Set no_stack_reg.
- (find_reg): Use it.
-
+ * global.c (struct allocno): Add no_stack_reg.
+ (global_conflicts): Set no_stack_reg.
+ (find_reg): Use it.
+
2003-01-24 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
* doc/passes.texi: Fix typo.
2003-01-21 Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
- PR opt/7507
- * calls.c (fix_unsafe_tree): Split out from ...
- (expand_call): ... here. Use it on the function address too.
+ PR opt/7507
+ * calls.c (fix_unsafe_tree): Split out from ...
+ (expand_call): ... here. Use it on the function address too.
2003-01-19 Roger Sayle <roger@eyesopen.com>
- * config/pa/pa.md (muldi3): Avoid invalid sharing of SUBREG RTXs.
+ * config/pa/pa.md (muldi3): Avoid invalid sharing of SUBREG RTXs.
2003-01-19 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2003-01-07 Benjamin Kosnik <bkoz@redhat.com>
Sunil Davasam <sunil.k.davasam@intel.com>
- PR libstdc++/9076
- * unwind-dw2.c (execute_cfa_program): DW_CFA_undefined,
- DW_CFA_same_value, read next and ignore.
+ PR libstdc++/9076
+ * unwind-dw2.c (execute_cfa_program): DW_CFA_undefined,
+ DW_CFA_same_value, read next and ignore.
2003-01-07 Richard Henderson <rth@redhat.com>
2002-11-26 David Edelsohn <edelsohn@gnu.org>
- * config/rs6000/rs6000.c (rs6000_flag_pic): New variable.
+ * config/rs6000/rs6000.c (rs6000_flag_pic): New variable.
(rs6000_override_options): Save original flag_pic value.
(rs6000_encode_section_info): More accurate test for "local" symbol.
#if defined (WORD_REGISTER_OPERATIONS) && defined (LOAD_EXTEND_OP)
/* If this is a typical RISC machine, we only have to worry
about the way loads are extended. */
- if (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND
- ? (((nonzero
- & (((unsigned HOST_WIDE_INT) 1
- << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1))))
- != 0))
- : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND)
+ if ((LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND
+ ? (((nonzero
+ & (((unsigned HOST_WIDE_INT) 1
+ << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1))))
+ != 0))
+ : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND)
+ || GET_CODE (SUBREG_REG (x)) != MEM)
#endif
{
/* On many CISC machines, accessing an object in a wider mode
if ((GET_MODE_SIZE (GET_MODE (x))
> GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
- && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND)
+ && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND
+ && GET_CODE (SUBREG_REG (x)) == MEM)
return num_sign_bit_copies (SUBREG_REG (x), mode);
#endif
#endif
-/* Verify wehther math functions are simplified. */
-double sin(double);
-double floor(double);
-float
-t(float a)
-{
- return sin(a);
-}
-float
-q(float a)
-{
- return floor(a);
-}
-double
-q1(float a)
-{
- return floor(a);
-}
-float
-q2(double a)
-{
- return floor(a);
-}
-main()
-{
-#ifdef __OPTIMIZE__
- if (t(0)!=0)
- abort ();
- if (q(0)!=0)
- abort ();
- if (q1(0)!=0)
- abort ();
- if (q2(0)!=0)
- abort ();
-#endif
- return 0;
-}
-__attribute__ ((noinline))
-double
-floor(double a)
-{
- abort ();
-}
-__attribute__ ((noinline))
-float
-floorf(float a)
-{
- return a;
-}
-__attribute__ ((noinline))
-double
-sin(double a)
-{
- abort ();
-}
-__attribute__ ((noinline))
-float
-sinf(float a)
-{
- return a;
+/* PR optimization/9279 */
+/* Verify that the combiner zero-extends
+ variables correctly. */
+
+extern void abort (void);
+
+int x = 0;
+char c, a = -1;
+char *p = &c;
+
+int main (void)
+{
+ if ((x ? 0 : (unsigned char)(*p = a)) == -1)
+ abort();
+
+ return 0;
}