Commit 3fd3b156 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/47541 (For integer pointers, the value of ++*p is not…

re PR tree-optimization/47541 (For integer pointers, the value of ++*p  is not written back to memory)

2011-02-01  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/47541
	* tree-ssa-structalias.c (push_fields_onto_fieldstack): Make
	sure to have a field at offset zero.

	* g++.dg/torture/pr47541.C: New testcase.

From-SVN: r169468
parent 3eaa6afc
2011-02-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47541
* tree-ssa-structalias.c (push_fields_onto_fieldstack): Make
sure to have a field at offset zero.
2011-01-31 Joseph Myers <joseph@codesourcery.com> 2011-01-31 Joseph Myers <joseph@codesourcery.com>
* config/arc/arc.opt (EB, EL): New Driver options. * config/arc/arc.opt (EB, EL): New Driver options.
......
2011-02-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47541
* g++.dg/torture/pr47541.C: New testcase.
2011-01-31 Janus Weil <janus@gcc.gnu.org> 2011-01-31 Janus Weil <janus@gcc.gnu.org>
PR fortran/47455 PR fortran/47455
......
/* { dg-do run } */
struct Dummy {};
struct RefCount : public Dummy {
~RefCount(); /* Has to be non-pod. */
int *a;
int *b;
};
RefCount::~RefCount(){}
struct Wrapper : public Dummy { RefCount ref; };
void __attribute__((noinline,noclone))
Push(Wrapper ptr)
{
*ptr.ref.b = 0;
}
extern "C" void abort (void);
int main()
{
int a = 1, b = 1;
Wrapper x;
x.ref.a = &a;
x.ref.b = &b;
Push(x);
if (b != 0)
abort ();
return 0;
}
...@@ -5083,6 +5083,19 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack, ...@@ -5083,6 +5083,19 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
if (!VEC_empty (fieldoff_s, *fieldstack)) if (!VEC_empty (fieldoff_s, *fieldstack))
pair = VEC_last (fieldoff_s, *fieldstack); pair = VEC_last (fieldoff_s, *fieldstack);
/* If there isn't anything at offset zero, create sth. */
if (!pair
&& offset + foff != 0)
{
pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
pair->offset = 0;
pair->size = offset + foff;
pair->has_unknown_size = false;
pair->must_have_pointers = false;
pair->may_have_pointers = false;
pair->only_restrict_pointers = false;
}
if (!DECL_SIZE (field) if (!DECL_SIZE (field)
|| !host_integerp (DECL_SIZE (field), 1)) || !host_integerp (DECL_SIZE (field), 1))
has_unknown_size = true; has_unknown_size = true;
......
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