public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/12661] New: [tree-ssa] gimplification failure
@ 2003-10-17 16:37 steven at gcc dot gnu dot org
  2003-10-17 16:38 ` [Bug optimization/12661] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: steven at gcc dot gnu dot org @ 2003-10-17 16:37 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
@ 2003-10-17 16:38 ` pinskia at gcc dot gnu dot org
  2003-10-17 16:38 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-17 16:38 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |green at redhat dot com


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-17 16:38 -------
*** Bug 12645 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
  2003-10-17 16:38 ` [Bug optimization/12661] " pinskia at gcc dot gnu dot org
@ 2003-10-17 16:38 ` pinskia at gcc dot gnu dot org
  2003-10-17 16:42 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-17 16:38 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-17 16:38 -------
*** Bug 12646 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
  2003-10-17 16:38 ` [Bug optimization/12661] " pinskia at gcc dot gnu dot org
  2003-10-17 16:38 ` pinskia at gcc dot gnu dot org
@ 2003-10-17 16:42 ` pinskia at gcc dot gnu dot org
  2003-10-17 19:52 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-17 16:42 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2003-10-17 16:40:38
               date|                            |
   Target Milestone|---                         |tree-ssa


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-17 16:40 -------
Bootstrap on arm and mips are also failing because this (see PR 12645 and bug 12646 which I 
closed as a dup of this one).


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-10-17 16:42 ` pinskia at gcc dot gnu dot org
@ 2003-10-17 19:52 ` jason at gcc dot gnu dot org
  2003-10-17 19:59 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2003-10-17 19:52 UTC (permalink / raw)
  To: gcc-bugs

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


jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2003-10-17 19:52 ` jason at gcc dot gnu dot org
@ 2003-10-17 19:59 ` jason at gcc dot gnu dot org
  2003-10-21 14:52 ` cvs-commit at gcc dot gnu dot org
  2003-10-21 15:51 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu dot org @ 2003-10-17 19:59 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From jason at gcc dot gnu dot org  2003-10-17 19:55 -------
This actually isn't a problem with gimplification, but rather with folding. 
TRUTH_NOT_EXPR isn't currently valid gimple, but it's generated by fold() during
optimization.

The right fix may just be to allow TRUTH_NOT_EXPR in gimple.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2003-10-17 19:59 ` jason at gcc dot gnu dot org
@ 2003-10-21 14:52 ` cvs-commit at gcc dot gnu dot org
  2003-10-21 15:51 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-10-21 14:52 UTC (permalink / raw)
  To: gcc-bugs

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



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-10-21 14:51 -------
Subject: Bug 12661

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	tree-ssa-20020619-branch
Changes by:	jason@gcc.gnu.org	2003-10-21 14:51:55

Modified files:
	gcc            : ChangeLog.tree-ssa tree-dfa.c tree-simple.c 
	                 gimplify.c 

Log message:
	PR optimization/12661
	* tree-dfa.c (get_expr_operands): Handle TRUTH_NOT_EXPR.
	* tree-simple.c (is_gimple_rhs): Allow TRUTH_NOT_EXPR.
	* gimplify.c (gimplify_expr) <TRUTH_NOT_EXPR>: Don't rewrite to an
	EQ_EXPR.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.768&r2=1.1.2.769
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-dfa.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.174&r2=1.1.4.175
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-simple.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.4.58&r2=1.1.4.59
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gimplify.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.97&r2=1.1.2.98


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug optimization/12661] [tree-ssa] gimplification failure
  2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2003-10-21 14:52 ` cvs-commit at gcc dot gnu dot org
@ 2003-10-21 15:51 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-21 15:51 UTC (permalink / raw)
  To: gcc-bugs

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-21 15:48 -------
Fixed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-10-21 15:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-17 16:37 [Bug optimization/12661] New: [tree-ssa] gimplification failure steven at gcc dot gnu dot org
2003-10-17 16:38 ` [Bug optimization/12661] " pinskia at gcc dot gnu dot org
2003-10-17 16:38 ` pinskia at gcc dot gnu dot org
2003-10-17 16:42 ` pinskia at gcc dot gnu dot org
2003-10-17 19:52 ` jason at gcc dot gnu dot org
2003-10-17 19:59 ` jason at gcc dot gnu dot org
2003-10-21 14:52 ` cvs-commit at gcc dot gnu dot org
2003-10-21 15:51 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).