diff options
author | Richard Stallman <rms@gnu.org> | 1993-07-15 02:16:57 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-07-15 02:16:57 +0000 |
commit | 5998c7dcc3c8f1c1825d3c8dc61aec0279bb540c (patch) | |
tree | aa7cb2bd7a4b24cbb58d0940306004c13a049a5f | |
parent | 477008025c8ae99fdaa6acd66e57b5a0616b3347 (diff) | |
download | gcc-5998c7dcc3c8f1c1825d3c8dc61aec0279bb540c.zip gcc-5998c7dcc3c8f1c1825d3c8dc61aec0279bb540c.tar.gz gcc-5998c7dcc3c8f1c1825d3c8dc61aec0279bb540c.tar.bz2 |
(expand_decl): Make a CONCAT, for decls of complex type.
From-SVN: r4922
-rw-r--r-- | gcc/stmt.c | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -2893,10 +2893,27 @@ expand_decl (decl) PROMOTE_MODE (reg_mode, unsignedp, type); } - DECL_RTL (decl) = gen_reg_rtx (reg_mode); - if (TREE_CODE (type) == POINTER_TYPE) - mark_reg_pointer (DECL_RTL (decl)); - REG_USERVAR_P (DECL_RTL (decl)) = 1; + if (TREE_CODE (type) == COMPLEX_TYPE) + { + rtx realpart, imagpart; + enum machine_mode partmode = TYPE_MODE (TREE_TYPE (type)); + + /* For a complex type variable, make a CONCAT of two pseudos + so that the real and imaginary parts + can be allocated separately. */ + realpart = gen_reg_rtx (partmode); + REG_USERVAR_P (realpart) = 1; + imagpart = gen_reg_rtx (partmode); + REG_USERVAR_P (imagpart) = 1; + DECL_RTL (decl) = gen_rtx (CONCAT, reg_mode, realpart, imagpart); + } + else + { + DECL_RTL (decl) = gen_reg_rtx (reg_mode); + if (TREE_CODE (type) == POINTER_TYPE) + mark_reg_pointer (DECL_RTL (decl)); + REG_USERVAR_P (DECL_RTL (decl)) = 1; + } } else if (TREE_CODE (DECL_SIZE (decl)) == INTEGER_CST) { |