[Top][All Lists]

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

[avr-gcc-list] Ways to fix gcc bug - builtin_return_address

From: Andy H
Subject: [avr-gcc-list] Ways to fix gcc bug - builtin_return_address
Date: Thu, 27 Mar 2008 19:18:16 -0400
User-agent: Thunderbird (Windows/20080213)

Anatoly and others.

Well the next bug on list of testsuite execute/torture failures for AVR is for gcc's builtin_return_address.

This function is rarely used. But instead of ignoring it, it would be better to fix it, that change test to exclude AVR.

Target is supposed to tell gcc the RTL address of the return address on the stack - from frame level. But at present it just adds 1 to frame pointer. So its wrong if anything is saved on stack - and/or there are local variables on stack) - duh!

We don't need any backs traces and there are other targets that only give return address for current frame. So only level 0 matters. The correct way is to get frame size and subtract that from frame pointer. Frame size is only known in late stages of compilation - so there needs to be a forward reference.

There would appear to be 3  ways I can do this

1) Create UNSPEC instruction that loads register with frame size (which will be known when instructions is output)
2) Create UNSPEC instruction that defines symbol= frame_size.
3) Find some way to get gcc output (2) rather than use UNSPEC.

What do you suggest ?


reply via email to

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