This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/46261] avr-gcc: Segfaults when compiled with the -mint8 option


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46261

--- Comment #17 from Georg-Johann Lay <gjl at gcc dot gnu.org> 2011-06-28 18:26:26 UTC ---
Instead of defining CHAR16_TYPE, I think it's preferred to define
UINT_LEAST16_TYPE appropriately and use logic in defaults.h so that defaults.h
need not to be changed. CHAR16_TYPE is not used in many places, and it appears
that defaults.h is included after tm.h.

UINT_LEAST16_TYPE comes from config/newlib-stdint.h which is merged into avr
headers in config.gcc.

So a fix inside AVR sandbox could be: 

A) Include a new file, say avr/stdint.h, instead of newlib-stdint.h.

or

B) Include newlib-stdint.h prior to avr.h and override as needed.

IMO A) is best because almost anything will have to be overwritten to render
-min8 functional again.

Moreover, note independant of this PR, that newlib-stdint.h makes some
definitions that are not correct for AVR like
   #define SIG_ATOMIC_TYPE "int" // should be "char" for AVR
So it's desired to have AVR-specific stdint.h, anyway.

The major drawback of -mint8 is that it's not covered by the testsuite at all
-- like most other AVR gadgets (ISR, progmem, ...)

If maintainers are willing to support this, I am sure someone will supply
according patch.

Johann


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]