]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/9279 ([ARM, Sparc] combine bug)
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 25 Jan 2003 16:02:11 +0000 (16:02 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 25 Jan 2003 16:02:11 +0000 (16:02 +0000)
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.

From-SVN: r61778

gcc/ChangeLog
gcc/combine.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20030125-1.c

index a443a1813062177a22f3a8cc23969ef59a39ce5a..74f127d6468565bb14e2269dc52b83575ce47622 100644 (file)
@@ -1,10 +1,23 @@
+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.
 
index 5e8ad1ac3a28ba0a607e143c637a93bc72a1ca8a..50c04b1abf57e5d4075a40da3854bfa9ef581b3b 100644 (file)
@@ -8305,12 +8305,13 @@ nonzero_bits (x, mode)
 #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
@@ -8533,7 +8534,8 @@ num_sign_bit_copies (x, 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
index 02dcd76dd57e5316b5896ee1290c6730a27ede92..e9c1d44285d04675a48b0055adf47173b8af4c57 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-25  Eric Botcazou  <ebotcazou@libertysurf.fr>
+            Christian Ehrhardt  <ehrhardt@mathematik.uni-ulm.de>
+
+       * gcc.c-torture/execute/20030125-1.c: New test.
+
 2003-01-25  Paolo Carlini  <pcarlini@unitus.it>
 
        Tweaks for Bison-1.875. From the NEWS file:
index 318974a38b5ace354ef7e4bbaaf6176910e7955d..224d4ef32261f95d659a7a6989c4bfa80ff11088 100644 (file)
@@ -1,61 +1,17 @@
-/* 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;
 }