https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01067.html
gcc/
PR middle-end/82577
* alias.c (compare_base_decls): Check HAS_DECL_ASSEMBLER_NAME_P,
use DECL_ASSEMBLER_NAME_RAW.
gcc/testsuite/
PR middle-end/82577
* g++.dg/opt/pr82577.C: New.
From-SVN: r253819
2017-10-17 Nathan Sidwell <nathan@acm.org>
+ PR middle-end/82577
+ * alias.c (compare_base_decls): Check HAS_DECL_ASSEMBLER_NAME_P,
+ use DECL_ASSEMBLER_NAME_RAW.
+
PR middle-end/82546
* tree.c (tree_code_size): Reformat. Punt to lang hook for unknown
TYPE nodes.
return 1;
/* If we have two register decls with register specification we
- cannot decide unless their assembler name is the same. */
+ cannot decide unless their assembler names are the same. */
if (DECL_REGISTER (base1)
&& DECL_REGISTER (base2)
+ && HAS_DECL_ASSEMBLER_NAME_P (base1)
+ && HAS_DECL_ASSEMBLER_NAME_P (base2)
&& DECL_ASSEMBLER_NAME_SET_P (base1)
&& DECL_ASSEMBLER_NAME_SET_P (base2))
{
- if (DECL_ASSEMBLER_NAME (base1) == DECL_ASSEMBLER_NAME (base2))
+ if (DECL_ASSEMBLER_NAME_RAW (base1) == DECL_ASSEMBLER_NAME_RAW (base2))
return 1;
return -1;
}
+2017-10-17 Nathan Sidwell <nathan@acm.org>
+
+ PR middle-end/82577
+ * g++.dg/opt/pr82577.C: New.
+
2017-10-17 Qing Zhao <qing.zhao@oracle.com>
Wilco Dijkstra <wilco.dijkstra@arm.com>
--- /dev/null
+// { dg-additional-options "-O2" }
+// PR c++/82577 ICE when optimizing
+
+class a {
+public:
+ int *b();
+};
+struct c {
+ int d;
+ a e;
+} f;
+void fn1(register c *g) {
+ register int *h;
+ do
+ (h) = g->e.b() + (g)->d;
+ while (&f);
+}