2024-11-22 00:02 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000039mercuryBugpublic2009-11-27 02:03
Reporterwangp 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000039: gcc 4.1.2 on x86-64 miscompiles computed gotos
DescriptionIn compiler/purity.m we needed a work around to avoid a segfault while purity checking invalid/purity/purity.m.
We get a segfault when jumping to the `unnecessary_promise_pure' branch.

Happens with gcc 4.1.2 on x86-64, at gcc -O1 and above.
Additional InformationThis also works around the problem. Note the volatile.

#define MR_COMPUTED_GOTO(val, labels) \
        { \
                static MR_Code *jump_table[] = { \
                        labels \
                }; \
                volatile int val1 = (val); \
                MR_GOTO(jump_table[val1]); \
        }
TagsNo tags attached.
Attached Files

-Relationships
related to 0000066resolvedwangp gcc 4.2 incompatibility 
+Relationships

-Notes

~0000190

pbone (administrator)

Julian suggested I look at this, saying it might be related to bug66.

It looks like there's a more general problem, GCC 4.x and in particular 4.3 loads addresses into registers in the prelude of a function and then dereferences the register later in the function.

I'm trying to solve the more general problem,
+Notes

-Issue History
Date Modified Username Field Change
2008-01-22 17:48 wangp New Issue
2009-09-26 06:24 pbone Note Added: 0000190
2009-09-26 06:26 pbone Relationship added related to 0000066
2009-11-24 00:18 wangp Status new => assigned
2009-11-24 00:18 wangp Assigned To => wangp
2009-11-27 02:03 wangp Status assigned => resolved
2009-11-27 02:03 wangp Resolution open => fixed
+Issue History