Skip to contentSkip to conversation

Warnings while compiling sparse

DISCUSSION Michael Stefaniuc 2 participants 3 messages Jul 30, 2007 Sparse checker

lore
Share & tools
lore
#0 lore raw

Hell Josh,

commit 06bcf19cb8eb3cc3154ba6131477d742a9f0b4b6

Author: Josh Triplett <[email protected]>
Date:   Sun Jul 29 20:20:38 2007 -0700

Makefile: Use -O2 -finline-functions, not just -O

introduces warnings while compiling sparse on my machine (FC6, x86, gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)):

CC parse.o
parse.c: In function ‘parse_enum_declaration’:
parse.c:676: warning: dereferencing type-punned pointer will break strict-aliasing rules parse.c:753: warning: dereferencing type-punned pointer will break strict-aliasing rules parse.c: In function ‘attribute_context’:
parse.c:890: warning: dereferencing type-punned pointer will break strict-aliasing rules parse.c: In function ‘apply_ctype’:
parse.c:1027: warning: dereferencing type-punned pointer will break strict-aliasing rules parse.c: In function ‘pointer’:
parse.c:1234: warning: dereferencing type-punned pointer will break strict-aliasing rules parse.c:1241: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC symbol.o
symbol.c: In function ‘examine_base_type’:
symbol.c:203: warning: dereferencing type-punned pointer will break strict-aliasing rules symbol.c: In function ‘merge_type’:
symbol.c:259: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC linearize.o
linearize.c: In function ‘insert_branch’:
linearize.c:663: warning: dereferencing type-punned pointer will break strict-aliasing rules linearize.c: In function ‘add_asm_input’:
linearize.c:1714: warning: dereferencing type-punned pointer will break strict-aliasing rules linearize.c: In function ‘add_asm_output’:
linearize.c:1732: warning: dereferencing type-punned pointer will break strict-aliasing rules linearize.c: In function ‘sort_switch_cases’:
linearize.c:1827: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC flow.o
flow.c: In function ‘kill_unreachable_bbs’:
flow.c:786: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC simplify.o
simplify.c: In function ‘if_convert_phi’:
simplify.c:47: warning: dereferencing type-punned pointer will break strict-aliasing rules simplify.c:49: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC liveness.o
liveness.c: In function ‘clear_liveness’:
liveness.c:225: warning: dereferencing type-punned pointer will break strict-aliasing rules liveness.c:226: warning: dereferencing type-punned pointer will break strict-aliasing rules liveness.c: In function ‘track_pseudo_liveness’:
liveness.c:270: warning: dereferencing type-punned pointer will break strict-aliasing rules liveness.c: In function ‘track_phi_uses’:
liveness.c:291: warning: dereferencing type-punned pointer will break strict-aliasing rules liveness.c: In function ‘track_pseudo_death_bb’:
liveness.c:345: warning: dereferencing type-punned pointer will break strict-aliasing rules liveness.c:348: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC storage.o
In file included from storage.c:17:
storage.h: In function ‘alloc_storage_hash’:
storage.h:72: warning: dereferencing type-punned pointer will break strict-aliasing rules storage.c: In function ‘gather_storage’:
storage.c:55: warning: dereferencing type-punned pointer will break strict-aliasing rules storage.c:68: warning: dereferencing type-punned pointer will break strict-aliasing rules storage.c: In function ‘combine_storage’:
storage.c:206: warning: dereferencing type-punned pointer will break strict-aliasing rules storage.c: In function ‘combine_phi_storage’:
storage.c:289: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC compile-i386.o
compile-i386.c: In function ‘push_cstring’:
compile-i386.c:475: warning: dereferencing type-punned pointer will break strict-aliasing rules compile-i386.c: In function ‘push_atom’:
compile-i386.c:480: warning: dereferencing type-punned pointer will break strict-aliasing rules compile-i386.c: In function ‘stack_alloc’:
compile-i386.c:521: warning: dereferencing type-punned pointer will break strict-aliasing rules compile-i386.c: In function ‘func_cleanup’:
compile-i386.c:778: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC example.o
In file included from example.c:15:
storage.h: In function ‘alloc_storage_hash’:
storage.h:72: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘flush_reg’:
example.c:403: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘add_pseudo_reg’:
example.c:463: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘kill_dead_reg’:
example.c:880: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘kill_pseudo’:
example.c:1018: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘generate_output_storage’:
example.c:1668: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘generate’:
example.c:1686: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c: In function ‘output_bb’:
example.c:1783: warning: dereferencing type-punned pointer will break strict-aliasing rules example.c:1784: warning: dereferencing type-punned pointer will break strict-aliasing rules
CC ctags.o
ctags.c: In function ‘main’:
ctags.c:205: warning: dereferencing type-punned pointer will break strict-aliasing rules

bye
michael

Signature · 2 lines
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
#1 lore raw
Quoted 1 line · Michael Stefaniuc

Hell Josh,

Hello to you too. :)

Quoted 8 lines

commit 06bcf19cb8eb3cc3154ba6131477d742a9f0b4b6

Author: Josh Triplett <[email protected]>
Date:   Sun Jul 29 20:20:38 2007 -0700

Makefile: Use -O2 -finline-functions, not just -O

introduces warnings while compiling sparse on my machine (FC6, x86, gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)):

Yes, it does here too. All of this comes from the ptrlist code, which does indeed break the C99 strict-aliasing rules in its pointer casts. Either we need -fno-strict-aliasing or we need to type-pun through a union; we most likely want the latter, though it'll uglify the ptrlist code.

- Josh Triplett

#2 lore raw
Quoted 4 lines · Josh Triplett
Quoted 1 line · Michael Stefaniuc

Hell Josh,

Hello to you too. :)

Duh ... I'm really sorry about that.
/me blames it on the cut'n'paste from thunderbird to mutt

bye
michael

Quoted 14 lines
Quoted 8 lines

commit 06bcf19cb8eb3cc3154ba6131477d742a9f0b4b6

Author: Josh Triplett <[email protected]>
Date:   Sun Jul 29 20:20:38 2007 -0700

Makefile: Use -O2 -finline-functions, not just -O

introduces warnings while compiling sparse on my machine (FC6, x86, gcc version 4.1.2 20070626 (Red Hat 4.1.2-13)):

Yes, it does here too. All of this comes from the ptrlist code, which does indeed break the C99 strict-aliasing rules in its pointer casts. Either we need -fno-strict-aliasing or we need to type-pun through a union; we most likely want the latter, though it'll uglify the ptrlist code.

Signature · 7 lines
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Hauptstätter Strasse 58, 70178 Stuttgart
Handelsregister: Amtsgericht Stuttgart HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
                 Werner Knoblich