Compiler error

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am getting a message when compiling

Internal compiler error: illegal instruction

DOH!?

Compiler version 20100110
IDE JGrasp

OS windows98

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is that message from the compiler proper?
Or from the compiler driver?
Or from the assembler?
Or from the linker?

And there is definitely more than just "Internal compiler error: illegal instruction", insn't it?

WinAVR-user-manual.txt wrote:
For Windows 95 and 98 users, see the autoexec.bat file in the root drive where your OS is installed. This is usually in C:\.
So it appears there should be support for '98.

...but maybe that line is outdated and was just copied from earlier version of that file?

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very likely the processor in that PC is too old.

https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=73686

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mea culpa...

Optimisation option in make set to (s)ize.
setting it to 0 cleared up the problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ignoramus wrote:
Optimisation option in make set to (s)ize.
setting it to 0 cleared up the problem.
Not really. You don't want to have level 0. 's' was a good choice.

Perhaps you misunderstood what I wrote about "optimization" in the other thread. That is in no way related to the optimization level you select for your AVR code. It is related to the compiler options used by Eric when he built the avr-gcc contained in WinAVR. There are other avr-gcc binaries for Windows, try those instead.

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was referring to the optimisation of my code.

Initially I had a for statement in a function which was flagged with a warning

warning: suggest parentheses around assignment used as truth value

we are talking a for loop

for( j=0; j=64; j++)
{
...
}

I then changed to a while() statement and that caused an errors.
The error was eliminated by switching optimisation off.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SOLVED... environment variables within jGrasp were off colour...

bugger .. mutter mutter...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Stefan: You have an idea how to build an application (avr-tools in this case) so that there are as few as possible assumptions on the host hardware?

avrfreaks does not support Opera. Profile inactive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SprinterSB wrote:
@Stefan: You have an idea how to build an application (avr-tools in this case) so that there are as few as possible assumptions on the host hardware?
Not really. Obviously to achieve that the host compiler must be forced to use only the lowest common denominator of x86 instructions. Perhaps something like -march=i386? Or at least i586?

Stefan Ernst

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe you should examine your code again.

 for ( j=0; j=64; j++ ) 

that is what the error message is trying to tell you. You are using an assignment where the compiler is expecting a comparison, like j==64. This is why some programmers start to write the compare statement like 64==j. Logical it's the same, but the compiler will throw an error if you write it as 64=j, because you would try to assign a value to a constant.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ignoramus wrote:

for( j=0; j=64; j++)
{
...
}


This code is faulty in more than one way.

The way it is set up, it is going to run forever, j being 64 in each iteration.

This is because you assign 64 to j before each iteration. Also, since 64 is nonzero, the loop will never end.

If you replace the code, like somebody else suggested, with :

for( j=0; j==64; j++)
{
...
}

Then the loop will never run, because j is 0.

It's hard to say what you are trying to do, my best guess would be this :

for( j=0; j<=64; j++)
{
...
}

Sid

Life... is a state of mind