[Bug optimization/12661] New: [tree-ssa] gimplification failure

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Oct 17 16:37:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [tree-ssa] gimplification failure
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,jason at gcc dot gnu dot
                    org,jeroen dot dobbelaere at acunia dot com

This snippet is not correctly gimplified:

void
foo (void)
{
  int target_flags;
  if ((target_flags >> 9) & 1)
    {
      if (((target_flags >> 9) & 1) !=
          ((target_flags >> 11) && (target_flags >> 11)))
        return;
    }
}

The (cleaned-up) .t05.gimple dump looks like this.

;; Function foo (foo)
                                                                                
foo ()
{
  int T.1;
  int T.2;
  _Bool T.3;
  int T.4;
  _Bool T.5;
  _Bool T.6;
  int target_flags;
                                                                                
  T.1 = target_flags >> 9;
  T.2 = T.1 & 1;
  T.3 = (_Bool)T.2;
  if (T.3)
    {
      T.1 = target_flags >> 9;
      T.2 = T.1 & 1;
      T.3 = (_Bool)T.2;
      T.4 = target_flags >> 11;
      T.5 = T.4 != 0;
      T.6 = T.3 ^ T.5;
      if (T.6)
        return;
    }
}

Note the "T.5 = T.4 != 0" line.  This causes an ICE in get_expr_operands():

unhandled expression in get_expr_operands():
 <truth_not_expr 0x401b2440
    type <boolean_type 0x4014e740 _Bool unsigned QI
        size <integer_cst 0x4014c138 constant invariant 8>
        unit size <integer_cst 0x4014c150 constant invariant 1>
        align 8 symtab 0 alias set -1 precision 1 min <integer_cst 0x4014c510 0>
max <integer_cst 0x4014c558 1>>
    
    arg 0 <ssa_name 0x401b23c0 type <boolean_type 0x4014e740 _Bool>
       >>
 
 
t.c: In function `foo':
 
t.c:4: internal compiler error: in get_expr_operands, at tree-dfa.c:540

This test case was reduced from simplify-rtx.c for armv5l-unknown-linux-gnu. 
Bootstrap for that target fails because of this bug.



More information about the Gcc-bugs mailing list