backport: re PR tree-optimization/81977 (Issue with inline memcpy with optimizations enabled)
2017-08-29 Richard Biener <rguenther@suse.de> Backport from mainline 2017-08-28 Richard Biener <rguenther@suse.de> PR tree-optimization/81977 * tree-ssa-sccvn.c (vn_reference_lookup_3): Fix look through memcpy. * g++.dg/torture/pr81977.C: New testcase. 2017-08-28 Richard Biener <rguenther@suse.de> PR debug/81993 * dwarf2out.c (gen_remaining_tmpl_value_param_die_attributes): Do nothing for removed DIEs. From-SVN: r251399
This commit is contained in:
parent
cf496a34a3
commit
897c0169ea
@ -1,3 +1,18 @@
|
||||
2017-08-29 Richard Biener <rguenther@suse.de>
|
||||
|
||||
Backport from mainline
|
||||
2017-08-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/81977
|
||||
* tree-ssa-sccvn.c (vn_reference_lookup_3): Fix look through
|
||||
memcpy.
|
||||
|
||||
2017-08-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR debug/81993
|
||||
* dwarf2out.c (gen_remaining_tmpl_value_param_die_attributes):
|
||||
Do nothing for removed DIEs.
|
||||
|
||||
2017-08-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
Backport from mainline
|
||||
|
@ -26058,7 +26058,8 @@ gen_remaining_tmpl_value_param_die_attribute (void)
|
||||
j = 0;
|
||||
FOR_EACH_VEC_ELT (*tmpl_value_parm_die_table, i, e)
|
||||
{
|
||||
if (!tree_add_const_value_attribute (e->die, e->arg))
|
||||
if (!e->die->removed
|
||||
&& !tree_add_const_value_attribute (e->die, e->arg))
|
||||
{
|
||||
dw_loc_descr_ref loc = NULL;
|
||||
if (! early_dwarf
|
||||
|
@ -1,3 +1,11 @@
|
||||
2017-08-29 Richard Biener <rguenther@suse.de>
|
||||
|
||||
Backport from mainline
|
||||
2017-08-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/81977
|
||||
* g++.dg/torture/pr81977.C: New testcase.
|
||||
|
||||
2017-08-28 Richard Biener <rguenther@suse.de>
|
||||
|
||||
Backport from mainline
|
||||
|
55
gcc/testsuite/g++.dg/torture/pr81977.C
Normal file
55
gcc/testsuite/g++.dg/torture/pr81977.C
Normal file
@ -0,0 +1,55 @@
|
||||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target int32plus } */
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t x ;
|
||||
uint16_t y ;
|
||||
uint64_t z ;
|
||||
} __attribute__((packed, aligned(1))) TestMsgType;
|
||||
|
||||
struct Payload
|
||||
{
|
||||
uint16_t header_info[2];
|
||||
TestMsgType _pref;
|
||||
void Pack(uint8_t *buffer)
|
||||
{
|
||||
__builtin_memcpy(buffer, &_pref, sizeof(_pref));
|
||||
}
|
||||
void UnPack(uint8_t *buffer)
|
||||
{
|
||||
__builtin_memcpy(&_pref, buffer, sizeof(_pref));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct Msg
|
||||
{
|
||||
Payload _payload;
|
||||
void Pack(uint8_t *buffer)
|
||||
{
|
||||
_payload.Pack(buffer);
|
||||
}
|
||||
|
||||
void UnPack(uint8_t *buffer)
|
||||
{
|
||||
_payload.UnPack(buffer);
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
uint8_t * buffer = new uint8_t [30];
|
||||
Msg msg;
|
||||
Msg msg1;
|
||||
msg._payload._pref.x = 0xabcd;
|
||||
msg._payload._pref.y = 0xa;
|
||||
msg._payload._pref.z = 0x0001020304051617;
|
||||
msg.Pack(&buffer[0]);
|
||||
msg1.UnPack(&buffer[0]);
|
||||
if (msg1._payload._pref.x != 0xabcd)
|
||||
__builtin_abort ();
|
||||
delete [] buffer;
|
||||
}
|
@ -2304,7 +2304,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_,
|
||||
memset (&op, 0, sizeof (op));
|
||||
op.type = vr->type;
|
||||
op.opcode = MEM_REF;
|
||||
op.op0 = build_int_cst (ptr_type_node, at - rhs_offset);
|
||||
op.op0 = build_int_cst (ptr_type_node, at - lhs_offset + rhs_offset);
|
||||
op.off = at - lhs_offset + rhs_offset;
|
||||
vr->operands[0] = op;
|
||||
op.type = TREE_TYPE (rhs);
|
||||
|
Loading…
Reference in New Issue
Block a user