Saturday, 19 July 2014

[gccsdk] [Bug 255] New: GCC 4.7.4 Rel 1 Dev 2014-05-29: infinite loop with level 2 optimisation

http://www.riscos.info/bugzilla3/show_bug.cgi?id=255

Summary: GCC 4.7.4 Rel 1 Dev 2014-05-29: infinite loop with
level 2 optimisation
Product: GCC/GCCSDK
Version: other
Platform: Other
OS/Version: RISC OS
Status: NEW
Severity: normal
Priority: P1
Component: C compiler
AssignedTo: John.Tytgat@aaug.net
ReportedBy: duncan.moore@gmx.com
Estimated Hours: 0.0


gcc (GCCSDK GCC 4.7.4 Release 1 Development) 4.7.4 20140529 (prerelease)
[gcc-4_7-branch revision 211052]
SharedUnixLibrary 1.12
VirtualRPC-Adjust RISCOS 4.39, ARM 710

I've previously reported this problem on the GCC mailing list (thread "GCC
4.7.4 Rel 1 Dev 2014-01-08: initial comments and feedback" starting 2014-02-27,
where there's more information), but thought I'd put it in the bug tracking
system so it doesn't get forgotten.

With this program:

#include <stdio.h>
int main(void) {
int i;
for (i=0;i<6;++i)
printf("%i\n",i);
return 0;
}

I get an infinite loop with -O2 optimisation:

*gcc abc.c -O2
*a/out
0
1
2
3
4
5
6
7
8
9
10
11
12
etc

With -O1 or -O3 optimisation, it works properly and just prints the integers 0
to 5.
As far as I know, no one else has been able to reproduce this.

--
Configure bugmail: http://www.riscos.info/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.

_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment