This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[vta] expand COMPLEX_CST into CONCATs in debug stmts=>insns

We don't want to create constant pool entries for debug annotations.
Not just because it wastes actual memory, but also because it may
upset label ordering, causing (harmless AFAICT) compare-debug
failures.  Fixed thusly.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <>

	* cfgexpand.c (expand_debug_expr): Expand COMPLEX_CST into CONCAT.

Index: gcc/cfgexpand.c
--- gcc/cfgexpand.c.orig	2008-09-11 03:49:57.000000000 -0300
+++ gcc/cfgexpand.c	2008-09-20 05:52:59.000000000 -0300
@@ -2017,10 +2017,17 @@ expand_debug_expr (tree exp)
     case INTEGER_CST:
     case REAL_CST:
     case FIXED_CST:
-    case COMPLEX_CST:
       op0 = expand_expr (exp, NULL_RTX, mode, EXPAND_INITIALIZER);
       return op0;
+    case COMPLEX_CST:
+      gcc_assert (COMPLEX_MODE_P (mode));
+      op0 = expand_debug_expr (TREE_REALPART (exp));
+      op0 = wrap_constant (GET_MODE_INNER (mode), op0);
+      op1 = expand_debug_expr (TREE_IMAGPART (exp));
+      op1 = wrap_constant (GET_MODE_INNER (mode), op1);
+      return gen_rtx_CONCAT (mode, op0, op1);
     case VAR_DECL:
     case PARM_DECL:
     case FUNCTION_DECL:
Alexandre Oliva
Free Software Evangelist  oliva@{,}
FSFLA Board Member       ÂSÃ Libre! =>
Red Hat Compiler Engineer   aoliva@{,}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]