This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/16437] New: New c-torture failures after bitfield patch


gcc.c-torture/execute/991118-1.c and gcc.c-torture/execute/bf64-1.c started
failing after the fix for PR2511 and PR3325 went into mainline.

2004-07-08  Joseph S. Myers  <jsm@polyomino.org.uk>
            Neil Booth  <neil@daikokuya.co.uk>
                                                                                
        PR c/2511
        PR c/3325
        * c-decl.c (finish_struct): Ensure bit-fields are given the
        correct type.
        * c-common.c (c_common_signed_or_unsigned_type): For C, require
        the precision to match as well as the mode.
        * expr.c (reduce_to_bit_field_precision): New function.
        (expand_expr_real_1): Reduce expressions of bit-field type to
        proper precision.
        * langhooks.h (reduce_bit_field_operations): New hook.
        * langhooks-def.h (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS):
        Define.
        * c-lang.c, objc/objc-lang.c
        (LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS): Define.
        * objc/objc-act.c (check_ivars): Convert types to bit-field types
        before checking.
        * tree.c (build_nonstandard_integer_type): New function.
        * tree.h (build_nonstandard_integer_type): New prototype.
        * tree-ssa.c (tree_ssa_useless_type_conversion_1): Don't treat
        conversions between integer and boolean types as useless.

We are getting confused very early on.  Probably in fold.  Here's a diff between
the bad .03.original (-) and the good .03.original dumps (+).

$ diff -dup 00bad/bf64-1.c.t03.original 00good/
--- 00bad/bf64-1.c.t03.original 2004-07-08 11:13:56.000000000 -0400
+++ 00good/bf64-1.c.t03.original        2004-07-08 11:14:35.000000000 -0400
@@ -13,7 +13,7 @@
 ;; enabled by -tree-original
  
 {
-  tmp2.field = (<unnamed type>)(long int)((long long int)tmp2.field |
2381903268435576);
+  tmp2.field = tmp2.field | 2381903268435576;
   return tmp2;
 }
  
@@ -23,18 +23,18 @@
 ;; enabled by -tree-original
  
 {
-  struct tmp tmp = {.pad=291, .field=-1099243257841};
-  struct tmp2 tmp2 = {.field=-1099243257841, .pad=291};
+  struct tmp tmp = {.pad=291, .field=4502500384112655};
+  struct tmp2 tmp2 = {.field=4502500384112655, .pad=291};
  
-    struct tmp tmp = {.pad=291, .field=-1099243257841};
-    struct tmp2 tmp2 = {.field=-1099243257841, .pad=291};
+    struct tmp tmp = {.pad=291, .field=4502500384112655};
+    struct tmp2 tmp2 = {.field=4502500384112655, .pad=291};
   tmp = sub (tmp);
   tmp2 = sub2 (tmp2);
-  if (1)
+  if ((int)tmp.pad != 291 || (long long unsigned int)tmp.field != 01fff567f)
     {
       abort ();
     }
-  if (1)
+  if ((int)tmp2.pad != 291 || (long long unsigned int)tmp2.field != 01fff567f)
     {
       abort ();
     }

-- 
           Summary: New c-torture failures after bitfield patch
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: jsm28 at gcc dot gnu dot org
        ReportedBy: dnovillo at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,neil at daikokuya dot co
                    dot uk
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16437


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]