Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
c8df72c4
Commit
c8df72c4
authored
Feb 04, 2019
by
Jakub Jelinek
Committed by
Jakub Jelinek
Feb 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* g++.dg/torture/alias-1.C: New test.
From-SVN: r268510
parent
4a7df256
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/torture/alias-1.C
+57
-0
No files found.
gcc/testsuite/ChangeLog
View file @
c8df72c4
2019-02-04 Jakub Jelinek <jakub@redhat.com>
* g++.dg/torture/alias-1.C: New test.
2019-02-03 Martin Sebor <msebor@redhat.com>
2019-02-03 Martin Sebor <msebor@redhat.com>
PR c/69661
PR c/69661
...
...
gcc/testsuite/g++.dg/torture/alias-1.C
0 → 100644
View file @
c8df72c4
// Verify we don't try to allocate the same stack slot for
// buf1 and buf2 in qux. While there is a CLOBBER stmt for buf1
// from inlined destructor, the buf1 variable doesn't go out of scope
// until after the baz call.
// { dg-do run }
#include <new>
#include <cstring>
#include <cstdlib>
char
*
p
;
struct
S
{
char
buf
[
128
];
S
()
{
memset
(
buf
,
' '
,
128
);
};
~
S
()
{};
};
__attribute__
((
noipa
))
void
foo
(
char
*
x
)
{
p
=
x
;
}
__attribute__
((
noipa
))
int
bar
(
S
*
x
)
{
return
x
->
buf
[
12
];
}
__attribute__
((
noipa
))
void
baz
(
char
*
x
)
{
S
*
a
=
new
(
p
)
(
S
);
S
*
b
=
new
(
x
)
(
S
);
memset
(
a
->
buf
,
'0'
,
128
);
memset
(
b
->
buf
,
'1'
,
128
);
if
(
bar
(
a
)
!=
'0'
||
bar
(
b
)
!=
'1'
)
abort
();
b
->~
S
();
a
->~
S
();
}
__attribute__
((
noipa
))
void
qux
()
{
char
buf1
[
128
];
foo
(
buf1
);
S
*
p
=
new
(
buf1
)
(
S
);
bar
(
p
);
p
->~
S
();
{
char
buf2
[
128
];
baz
(
buf2
);
}
}
int
main
()
{
qux
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment