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
2d8d91a8
Commit
2d8d91a8
authored
Nov 03, 2008
by
Eric Botcazou
Committed by
Eric Botcazou
Nov 03, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree-sra.c (bitfield_overlaps_p): Fix oversight.
From-SVN: r141556
parent
e73da78e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
0 deletions
+47
-0
gcc/ChangeLog
+4
-0
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/gnat.dg/array5.adb
+34
-0
gcc/tree-sra.c
+5
-0
No files found.
gcc/ChangeLog
View file @
2d8d91a8
2008
-
11
-
03
Eric
Botcazou
<
ebotcazou
@adacore
.
com
>
*
tree
-
sra
.
c
(
bitfield_overlaps_p
)
:
Fix
oversight
.
2008
-
11
-
03
Rainer
Orth
<
ro
@TechFak
.
Uni
-
Bielefeld
.
DE
>
PR
other
/
37463
...
...
gcc/testsuite/ChangeLog
View file @
2d8d91a8
2008-11-03 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array5.adb New test.
2008-11-03 Richard Guenther <rguenther@suse.de>
Jakub Jelinek <jakub@redhat.com>
...
...
gcc/testsuite/gnat.dg/array5.adb
0 → 100644
View file @
2d8d91a8
-- { dg-do run }
-- { dg-options "-O" }
procedure Array5 is
type myint is range 0 .. 100_000;
Bla : constant myint := 359;
type my_array is array (1 .. 2) of myint;
type item is record
Length : Integer;
Content : my_array;
end record;
procedure create_item (M : out item) is
begin
M.Length := 1;
M.Content := (others => Bla);
end;
Var : item;
begin
create_item (Var);
if Var.Length = 1
and then Var.Content (1) = Bla
then
null;
else
raise Program_Error;
end if;
end;
gcc/tree-sra.c
View file @
2d8d91a8
...
...
@@ -2961,8 +2961,13 @@ bitfield_overlaps_p (tree blen, tree bpos, struct sra_elt *fld,
}
else
if
(
TREE_CODE
(
fld
->
element
)
==
INTEGER_CST
)
{
tree
domain_type
=
TYPE_DOMAIN
(
TREE_TYPE
(
fld
->
parent
->
element
));
flen
=
fold_convert
(
bitsizetype
,
TYPE_SIZE
(
fld
->
type
));
fpos
=
fold_convert
(
bitsizetype
,
fld
->
element
);
if
(
domain_type
&&
TYPE_MIN_VALUE
(
domain_type
))
fpos
=
size_binop
(
MINUS_EXPR
,
fpos
,
fold_convert
(
bitsizetype
,
TYPE_MIN_VALUE
(
domain_type
)));
fpos
=
size_binop
(
MULT_EXPR
,
flen
,
fpos
);
}
else
...
...
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