public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/49911] New: vrp2 + -fstrict-enums incorrectly remove predicate
@ 2011-07-30 14:35 rafael.espindola at gmail dot com
  2011-07-31  9:57 ` [Bug tree-optimization/49911] " rguenth at gcc dot gnu.org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: rafael.espindola at gmail dot com @ 2011-07-30 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: vrp2 + -fstrict-enums incorrectly remove predicate
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rafael.espindola@gmail.com


with a r176947 cc1plus, running

cc1plus -fstrict-enums -fdump-tree-all ~/tmpfs/test2.ii -fno-rtti
-fno-exceptions -fno-strict-aliasing   -m32 -O2

in

extern  void JS_Assert();
typedef enum {
eax,         ecx,         edx,         ebx,         esp,         ebp,        
esi,         edi     }
RegisterID;
union StateRemat {
  RegisterID reg_;
  int offset_;
};
static StateRemat FromRegister(RegisterID reg) {
  StateRemat sr;
  sr.reg_ = reg;
  return sr;
}
static StateRemat FromAddress3(int address) {
  StateRemat sr;
    sr.offset_ = address;
  //sr.offset_ = 0;
  if (address < 46 &&    address >= 0) {
    JS_Assert();
  }
  return sr;
}
struct FrameState {
  StateRemat dataRematInfo2(bool y, int z) {
    if (y)         return FromRegister(RegisterID(1));
    return FromAddress3(z);
  }
};
FrameState frame;
StateRemat x;
void jsop_setelem(bool y, int z) {
  x = frame.dataRematInfo2(y, z);
}

produces a test2.ii.123t.vrp2 with:

Folding predicate SR.6_11 <= 45 to 1

replacing the "sr.offset_ = address" line with sr.offset_ = 0 prevents the
transformation.


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

end of thread, other threads:[~2011-09-09  9:36 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-30 14:35 [Bug tree-optimization/49911] New: vrp2 + -fstrict-enums incorrectly remove predicate rafael.espindola at gmail dot com
2011-07-31  9:57 ` [Bug tree-optimization/49911] " rguenth at gcc dot gnu.org
2011-07-31 13:39 ` rafael.espindola at gmail dot com
2011-07-31 13:57 ` rafael.espindola at gmail dot com
2011-08-01  8:33 ` rguenth at gcc dot gnu.org
2011-08-01  8:34 ` [Bug tree-optimization/49911] SRA + DOM " rguenth at gcc dot gnu.org
2011-08-01  8:42 ` rguenth at gcc dot gnu.org
2011-08-01  8:45 ` [Bug tree-optimization/49911] SRA + DOM + VRP " rguenth at gcc dot gnu.org
2011-08-01  8:49 ` rguenth at gcc dot gnu.org
2011-08-01  9:06 ` rguenth at gcc dot gnu.org
2011-08-04 19:00 ` rafael.espindola at gmail dot com
2011-08-06 15:59 ` ebotcazou at gcc dot gnu.org
2011-08-06 16:08 ` ebotcazou at gcc dot gnu.org
2011-08-11 12:34 ` jamborm at gcc dot gnu.org
2011-08-11 13:37 ` rguenth at gcc dot gnu.org
2011-08-11 13:42 ` rguenth at gcc dot gnu.org
2011-08-12  8:02 ` ebotcazou at gcc dot gnu.org
2011-08-17 22:21 ` rafael.espindola at gmail dot com
2011-09-05 16:36 ` jamborm at gcc dot gnu.org
2011-09-05 17:15 ` rafael.espindola at gmail dot com
2011-09-06  7:30 ` rguenth at gcc dot gnu.org
2011-09-07 14:31 ` jamborm at gcc dot gnu.org
2011-09-07 15:04 ` rafael.espindola at gmail dot com
2011-09-07 15:49 ` jamborm at gcc dot gnu.org
2011-09-08 14:01 ` jamborm at gcc dot gnu.org
2011-09-08 17:30 ` jamborm at gcc dot gnu.org
2011-09-09  9:37 ` jamborm at gcc dot gnu.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).