aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bowman <james.bowman@ftdichip.com>2017-11-07 01:10:18 +0000
committerJames Bowman <jamesbowman@gcc.gnu.org>2017-11-07 01:10:18 +0000
commita297ccb52e0c894e8160c60319b71f5dedf28643 (patch)
treec31b6993e4e0c4ca358998c53b8653a22223ef00
parent853c0dfba2e6afe6dbb17e58c300b38670524890 (diff)
downloadgcc-a297ccb52e0c894e8160c60319b71f5dedf28643.zip
gcc-a297ccb52e0c894e8160c60319b71f5dedf28643.tar.gz
gcc-a297ccb52e0c894e8160c60319b71f5dedf28643.tar.bz2
FT32 makes use of multiple address spaces.
FT32 makes use of multiple address spaces. When trying to inspect objects in GDB, GDB was treating them as a straight "const". The cause seems to be in GCC DWARF2 output. This output is handled in gcc/gcc/dwarf2out.c, where modified_type_die() checks that TYPE has qualifiers CV_QUALS. However while TYPE has ADDR_SPACE qualifiers, the modified_type_die() explicitly discards the ADDR_SPACE qualifiers. This patch retains the ADDR_SPACE qualifiers as modified_type_die() outputs the DWARF type tree. This allows the types to match, and correct type information for the object is emitted. [gcc] 2017-11-06 James Bowman <james.bowman@ftdichip.com> * gcc/dwarf2out.c (modified_type_die): Retain ADDR_SPACE qualifiers. (add_type_attribute) likewise. From-SVN: r254484
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2out.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9353fd3..3690705 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-06 James Bowman <james.bowman@ftdichip.com>
+
+ * gcc/dwarf2out.c (modified_type_die): Retain ADDR_SPACE
+ qualifiers.
+ (add_type_attribute) likewise.
+
2017-11-06 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (ix86_can_use_return_insn_p): Use reference
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7344767..f396997 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12481,7 +12481,8 @@ modified_type_die (tree type, int cv_quals, bool reverse,
dw_die_ref mod_scope;
/* Only these cv-qualifiers are currently handled. */
const int cv_qual_mask = (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE
- | TYPE_QUAL_RESTRICT | TYPE_QUAL_ATOMIC);
+ | TYPE_QUAL_RESTRICT | TYPE_QUAL_ATOMIC |
+ ENCODE_QUAL_ADDR_SPACE(~0U));
const bool reverse_base_type
= need_endianity_attribute_p (reverse) && is_base_type (type);
@@ -20708,7 +20709,7 @@ add_type_attribute (dw_die_ref object_die, tree type, int cv_quals,
return;
type_die = modified_type_die (type,
- cv_quals | TYPE_QUALS_NO_ADDR_SPACE (type),
+ cv_quals | TYPE_QUALS (type),
reverse,
context_die);