Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000181 [libFirm] optimisations minor always 2016-10-10 13:35 2016-10-20 18:06
Reporter mohr View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version development
Summary 0000181: FIRM does not optimize loads from read-only (module-)global variables
Description FIRM fails to optimize the following program (also attached):

static int g = 0;
int main()
    if (g)
        return 1;
    return 0;

FIRM does not reduce this program to "return 0;", nor does it remove 'g'.

It seems that ir/ana/irmemory.c computes all necessary information about the usage of the entity 'g'. However, ir/opt/ldstopt.c seems not to consider read-only entities. Hence, 'g' is also not removed in the following (which FIRM can do as soon as the entity does not have any users any more).
Additional Information
Tags No tags attached.
Attached Files c file icon bla.c [^] (65 bytes) 2016-10-10 13:35

- Relationships

-  Notes
mohr (developer)
2016-10-20 18:06

Implemented necessary optimization in 20c9ab7ed2a19e3de4353263bc4431cd31291b1f.

- Issue History
Date Modified Username Field Change
2016-10-10 13:35 mohr New Issue
2016-10-10 13:35 mohr File Added: bla.c
2016-10-20 18:06 mohr Note Added: 0000274
2016-10-20 18:06 mohr Status new => resolved
2016-10-20 18:06 mohr Resolution open => fixed

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