Skip to content

Instantly share code, notes, and snippets.

@flgr
Created March 1, 2010 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flgr/318642 to your computer and use it in GitHub Desktop.
Save flgr/318642 to your computer and use it in GitHub Desktop.
--- libfirm/ir/be/ia32/ia32_common_transform.c 2009-12-22 18:14:45.000000000 +0100
+++ libfirm.new/ir/be/ia32/ia32_common_transform.c 2010-03-01 19:28:58.000000000 +0100
@@ -1062,16 +1062,6 @@
if (cnst != NULL) {
offset = get_Const_tarval(cnst);
- if (tarval_is_long(offset)) {
- val = get_tarval_long(offset);
- } else {
- ir_fprintf(stderr, "Optimisation Warning: tarval from %+F is not a "
- "long?\n", cnst);
- return NULL;
- }
-
- if (!check_immediate_constraint(val, immediate_constraint_type))
- return NULL;
}
if (symconst != NULL) {
if (immediate_constraint_type != 0) {
@@ -1093,6 +1083,19 @@
if (offset_sign && offset != NULL) {
offset = tarval_neg(offset);
}
+
+ if (offset != NULL) {
+ if (tarval_is_long(offset)) {
+ val = get_tarval_long(offset);
+ } else {
+ ir_fprintf(stderr, "Optimisation Warning: tarval from %+F is not a "
+ "long?\n", cnst);
+ return NULL;
+ }
+ }
+
+ if (!check_immediate_constraint(val, immediate_constraint_type))
+ return NULL;
new_node = ia32_create_Immediate(symconst_ent, symconst_sign, val);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment