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 rtl-optimization/33961] [4.3 regression] gcc 4.3 causes crash valid code to crash



------- Comment #4 from rguenth at gcc dot gnu dot org  2007-10-31 17:03 -------
Reduced testcase:

void decode(char *d, int len);

void decode(char *d, int len) {
        int i = len - 1;
        while(i >= 0) {
                d[i];
                if(d[i] == 0)
                        d[i]=' ';
                i--;
        }
}

int main(int argc, char **argv)
{
        decode("this bug is really weird", 24);
}

the store is turned into an unconditional store by the cselim pass, but
this store traps as the 'd' argument is in read-only memory.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |matz at gcc dot gnu dot org
           Severity|normal                      |blocker
             Status|UNCONFIRMED                 |NEW
          Component|tree-optimization           |rtl-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-31 17:03:11
               date|                            |


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


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