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
870cc33b
Commit
870cc33b
authored
Feb 16, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(build_indirect_ref): Avoid *& short-cut if -fvolatile.
From-SVN: r3475
parent
a73f14a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
30 deletions
+33
-30
gcc/c-typeck.c
+33
-30
No files found.
gcc/c-typeck.c
View file @
870cc33b
...
...
@@ -1109,37 +1109,40 @@ build_indirect_ref (ptr, errorstring)
register
tree
type
=
TREE_TYPE
(
pointer
);
if
(
TREE_CODE
(
type
)
==
POINTER_TYPE
)
if
(
TREE_CODE
(
pointer
)
==
ADDR_EXPR
&&
(
TREE_TYPE
(
TREE_OPERAND
(
pointer
,
0
))
==
TREE_TYPE
(
type
)))
return
TREE_OPERAND
(
pointer
,
0
);
else
{
tree
t
=
TREE_TYPE
(
type
);
register
tree
ref
=
build1
(
INDIRECT_REF
,
TYPE_MAIN_VARIANT
(
t
),
pointer
);
{
if
(
TREE_CODE
(
pointer
)
==
ADDR_EXPR
&&
!
flag_volatile
&&
(
TREE_TYPE
(
TREE_OPERAND
(
pointer
,
0
))
==
TREE_TYPE
(
type
)))
return
TREE_OPERAND
(
pointer
,
0
);
else
{
tree
t
=
TREE_TYPE
(
type
);
register
tree
ref
=
build1
(
INDIRECT_REF
,
TYPE_MAIN_VARIANT
(
t
),
pointer
);
if
(
TYPE_SIZE
(
t
)
==
0
&&
TREE_CODE
(
t
)
!=
ARRAY_TYPE
)
{
error
(
"dereferencing pointer to incomplete type"
);
return
error_mark_node
;
}
if
(
TREE_CODE
(
t
)
==
VOID_TYPE
)
warning
(
"dereferencing `void *' pointer"
);
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op.
And ANSI C seems to specify that the type of the result
should be the const type. */
/* A de-reference of a pointer to const is not a const. It is valid
to change it via some other pointer. */
TREE_READONLY
(
ref
)
=
TYPE_READONLY
(
t
);
TREE_SIDE_EFFECTS
(
ref
)
=
TYPE_VOLATILE
(
t
)
||
TREE_SIDE_EFFECTS
(
pointer
)
||
flag_volatile
;
TREE_THIS_VOLATILE
(
ref
)
=
TYPE_VOLATILE
(
t
)
||
flag_volatile
;
return
ref
;
}
if
(
TYPE_SIZE
(
t
)
==
0
&&
TREE_CODE
(
t
)
!=
ARRAY_TYPE
)
{
error
(
"dereferencing pointer to incomplete type"
);
return
error_mark_node
;
}
if
(
TREE_CODE
(
t
)
==
VOID_TYPE
)
warning
(
"dereferencing `void *' pointer"
);
/* We *must* set TREE_READONLY when dereferencing a pointer to const,
so that we get the proper error message if the result is used
to assign to. Also, &* is supposed to be a no-op.
And ANSI C seems to specify that the type of the result
should be the const type. */
/* A de-reference of a pointer to const is not a const. It is valid
to change it via some other pointer. */
TREE_READONLY
(
ref
)
=
TYPE_READONLY
(
t
);
TREE_SIDE_EFFECTS
(
ref
)
=
TYPE_VOLATILE
(
t
)
||
TREE_SIDE_EFFECTS
(
pointer
)
||
flag_volatile
;
TREE_THIS_VOLATILE
(
ref
)
=
TYPE_VOLATILE
(
t
)
||
flag_volatile
;
return
ref
;
}
}
else
if
(
TREE_CODE
(
pointer
)
!=
ERROR_MARK
)
error
(
"invalid type argument of `%s'"
,
errorstring
);
return
error_mark_node
;
...
...
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