Commit 8268ad5c by Jakub Jelinek

re PR middle-end/59776 (gcc -g -O1 ICE in expand_debug_locations, at cfgexpand.c:3865)

	PR debug/59776
	* tree-sra.c (load_assign_lhs_subreplacements): Add VIEW_CONVERT_EXPR
	around drhs if type conversion to lacc->type is not useless.

	* gcc.dg/guality/pr59776.c: New test.

From-SVN: r207695
parent e332c729
2014-02-11 Richard Henderson <rth@redhat.com>
Jakub Jelinek <jakub@redhat.com>
PR debug/59776
* tree-sra.c (load_assign_lhs_subreplacements): Add VIEW_CONVERT_EXPR
around drhs if type conversion to lacc->type is not useless.
2014-02-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2014-02-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64-cores.def (cortex-a57): Use cortexa57 * config/aarch64/aarch64-cores.def (cortex-a57): Use cortexa57
......
2014-02-11 Jakub Jelinek <jakub@redhat.com>
PR debug/59776
* gcc.dg/guality/pr59776.c: New test.
2014-02-11 Renlin Li <Renlin.Li@arm.com> 2014-02-11 Renlin Li <Renlin.Li@arm.com>
* gcc.target/arm/fixed_float_conversion.c: Add arm_vfp3 option. * gcc.target/arm/fixed_float_conversion.c: Add arm_vfp3 option.
......
/* PR debug/59776 */
/* { dg-do run } */
/* { dg-options "-g" } */
#include "../nop.h"
struct S { float f, g; };
__attribute__((noinline, noclone)) void
foo (struct S *p)
{
struct S s1, s2; /* { dg-final { gdb-test pr59776.c:17 "s1.f" "5.0" } } */
s1 = *p; /* { dg-final { gdb-test pr59776.c:17 "s1.g" "6.0" } } */
s2 = s1; /* { dg-final { gdb-test pr59776.c:17 "s2.f" "0.0" } } */
*(int *) &s2.f = 0; /* { dg-final { gdb-test pr59776.c:17 "s2.g" "6.0" } } */
asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr59776.c:20 "s1.f" "5.0" } } */
asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr59776.c:20 "s1.g" "6.0" } } */
s2 = s1; /* { dg-final { gdb-test pr59776.c:20 "s2.f" "5.0" } } */
asm volatile (NOP : : : "memory"); /* { dg-final { gdb-test pr59776.c:20 "s2.g" "6.0" } } */
asm volatile (NOP : : : "memory");
}
int
main ()
{
struct S x = { 5.0f, 6.0f };
foo (&x);
return 0;
}
...@@ -2950,6 +2950,10 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc, ...@@ -2950,6 +2950,10 @@ load_assign_lhs_subreplacements (struct access *lacc, struct access *top_racc,
lacc); lacc);
else else
drhs = NULL_TREE; drhs = NULL_TREE;
if (drhs
&& !useless_type_conversion_p (lacc->type, TREE_TYPE (drhs)))
drhs = fold_build1_loc (loc, VIEW_CONVERT_EXPR,
lacc->type, drhs);
ds = gimple_build_debug_bind (get_access_replacement (lacc), ds = gimple_build_debug_bind (get_access_replacement (lacc),
drhs, gsi_stmt (*old_gsi)); drhs, gsi_stmt (*old_gsi));
gsi_insert_after (new_gsi, ds, GSI_NEW_STMT); gsi_insert_after (new_gsi, ds, GSI_NEW_STMT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment