avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] -O3 problem


From: Paul Casteels
Subject: Re: [avr-gcc-list] -O3 problem
Date: Wed, 30 May 2001 15:45:49 +0200 (MET DST)

Hi,

In my previous mail I mentioned a compiler (avrgcc20010211.exe) crash
compiling a simple program with the strlen function with -O3 optimization.
-O2 optimization compiles but produces erroneous results.
Only -O1 seems reliable. I also had a code fragment with the abs()
function that produced wrong code with -O2. Is it unsafe to use greater
optimization then -O1 ? Do I need to get a newer version ?

Best regards and many thanks,

        Paul Casteels (address@hidden)

On Wed, 30 May 2001, Paul Casteels wrote:

> Hi,
>
> I am using Win32 avrgcc20010211.exe from http://8bit.at/avr.
>
> When I compile this with -O3 :
> #include <string.h>
>
> void tst(int dum) {
>       dum = dum + 1;
> }
>
> int main(void) {
>       char num_str[6];
>       int i;
>
>       num_str[0] = '0';
>       num_str[1] = 0;
>       i = 5 - strlen(num_str);
>       tst(i);
>       return 1;
> }
> I get :
> avr-gcc -c -g -O3 -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst
> -mmcu=at90s8515 -I. test.c -o test.o
> test.c: In function `main':
> test.c:16: Internal compiler error in print_rtl_and_abort, at flow.c:6514
> Please submit a full bug report.
>  See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> make: *** [test.o] Error 1
>
> If I compile with -O2 it works fine. From string.h I see :
> extern size_t strlen(const char *) __ATTR_PURE__;
> Does __ATTR_PURE__ mean it's an inline function ? It does look like that
> when I check the assembler output from -O2.
>
> Best regards,
>
>       Paul Casteels (address@hidden)
>
>
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]