Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000097 [cparser] firm graph generation minor always 2012-11-19 16:14 2016-01-03 03:30
Reporter Matze View Status public  
Assigned To Matze
Priority normal Resolution fixed  
Status closed   Product Version 0.9.14
Summary 0000097: -O0 code generation fails for some global initializers
Description With -O0 firm does not optimize/constant fold any nodes. Global initializers are currently expressed as firm nodes, but need to be optimized until we reach the backend, otherwise we can't emit gnu-assembler for it.

This fails for constructs like bool foo = 1; which cparser constructs as a CondJmp/Phi combination, in -O0 this never gets folded. The clean solution I see currently is introducing the concept of a constant and a link-time constant at the frontend level and let cparser fold the initializers for globals.
Additional Information Christopher Mallon already has a branch which does constant folding of cparser expressions to ir_tarvals, so we should take this branch and add a folding for link-time constants (which is probable a combination of ir_tarval + possible ir_entity reference).
Tags No tags attached.
Attached Files

- Relationships

-  Notes
Matze (administrator)
2013-01-16 12:41

afe9af3f2c67d0264740d11deaaf6a2de730a1fd adds workarounds for all known problematic cases.

- Issue History
Date Modified Username Field Change
2012-11-19 16:14 Matze New Issue
2012-11-19 16:14 Matze Status new => confirmed
2013-01-16 12:41 Matze Note Added: 0000150
2013-01-16 12:41 Matze Assigned To => Matze
2013-01-16 12:41 Matze Status confirmed => resolved
2013-01-16 12:41 Matze Resolution open => fixed
2016-01-03 03:30 Matze Status resolved => closed

Mantis 1.1.5[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker