GCC Bugzilla – Attachment 22951 Details for
Bug 47271
[4.6 Regression] if-conversion removes a test (if), the function generates invalid outputs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Example to reproduce the bug
peephole.c (text/plain), 1.27 KB, created by
Victor Stinner
on 2011-01-12 18:54:32 UTC
(
hide
)
Description:
Example to reproduce the bug
Filename:
MIME Type:
Creator:
Victor Stinner
Created:
2011-01-12 18:54:32 UTC
Size:
1.27 KB
patch
obsolete
>extern int printf (char *format, ...); > >void func() >{ > int i; > int nops; > unsigned char *codestr = >"|\000\000Ee\000\000Z\001\000d\000\000Z\002\000d\025\000Z\003\000" >"\t\t\t\t\t\t\t\t\t\t\t\td\026\000Z\004\000d\005\000\204\000\000Z" >"\005\000e\006\000e\a\000j\005\000e\b\000d\006\000\204\002\000\203" >"\001\000Z\t\000d\a\000\204\000\000Z\n\000d\b\000\204\000\000Z\v\000d" >"\t\000\204\000\000Z\f\000d\n\000\204\000\000Z\r\000e\016\000e\017\000d" >"\v\000\203\001\000d\f\000d\r\000\203\001\001Z\020\000e\016\000e\017" >"\000d\016\000\203\001\000d\f\000d\017\000\203\001\001Z\021\000e\016" >"\000e\017\000d\020\000\203\001\000d\f\000d\021\000\203\001\001Z\022" >"\000e\016\000e\017\000d\022\000\203\001\000d\f\000d\023\000\203\001" >"\001Z\023\000d\024\000S" >; > int codelen = 209; > int addrmap[500]; > > for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1)) { > addrmap[i] = i - nops; > if (codestr[i] == 9) > nops++; > } > > for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1)) > printf("addrmap[%i]=%i\n", i, addrmap[i]); > > for (i=0, nops=0 ; i<codelen ; i += ((codestr[i] >= 90) ? 3 : 1)) > { > if (addrmap[i] > codelen) > printf("ERROR FOR addrmap[%i]\n", i); > } >} > >int main() >{ > func(); > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 47271
: 22951 |
23106