summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/20000623-1.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-23 20:05:55 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-23 20:05:55 +0000
commitc7f6877a1954849f8da381c69f6d6e11bf47b4d5 (patch)
treef7d46e1f2a630caf82a788c880e071b187d02dab /gcc/testsuite/gcc.dg/20000623-1.c
parentaec4db28e65d581be5b02a3b884c8ad20eb58bfa (diff)
downloadgcc-c7f6877a1954849f8da381c69f6d6e11bf47b4d5.tar.gz
* alias.c (fixed_scalar_and_varying_struct_p): Don't examine
struct vs. scalar-ness when -fno-strict-aliasing. and a test case to test it, gcc.dg/20000623-1.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34668 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/20000623-1.c')
-rw-r--r--gcc/testsuite/gcc.dg/20000623-1.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20000623-1.c b/gcc/testsuite/gcc.dg/20000623-1.c
new file mode 100644
index 00000000000..0a5cd248f35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20000623-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-options "-O3 -fno-strict-aliasing" } */
+
+struct foos { int l; };
+int foo;
+static struct foos *getfoo(void);
+int main (void)
+{
+ struct foos *f = getfoo();
+ f->l = 1;
+ foo = 2;
+ if (f->l == 1)
+ abort();
+ exit(0);
+}
+static struct foos *getfoo(void)
+{ return (struct foos *)&foo; }