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
3eb92a3d
Commit
3eb92a3d
authored
May 11, 2015
by
Jan Hubicka
Committed by
Jan Hubicka
May 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree.c (verify_type_variant): Check TYPE_VALUES_RAW and TYPE_PRECISION
From-SVN: r222991
parent
dafb7b56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
0 deletions
+96
-0
gcc/ChangeLog
+4
-0
gcc/tree.c
+92
-0
No files found.
gcc/ChangeLog
View file @
3eb92a3d
2015-05-09 Jan Hubicka <hubicka@ucw.cz>
* tree.c (verify_type_variant): Check TYPE_VALUES_RAW and TYPE_PRECISION
2015-05-09 Jan Hubicka <hubicka@ucw.cz>
Patch by Richard Biener
* coverage.c (coverage_obj_init): Delay building of type variant
until the type is finished.
...
...
gcc/tree.c
View file @
3eb92a3d
...
...
@@ -12577,6 +12577,98 @@ verify_type_variant (const_tree t, tree tv)
debug_tree
(
TYPE_BINFO
(
t
));
return
false
;
}
/* Check various uses of TYPE_VALUES_RAW. */
if
(
TREE_CODE
(
t
)
==
ENUMERAL_TYPE
&&
TYPE_VALUES
(
t
)
!=
TYPE_VALUES
(
tv
))
{
error
(
"type variant has different TYPE_VALUES"
);
debug_tree
(
tv
);
error
(
"type variant's TYPE_VALUES"
);
debug_tree
(
TYPE_VALUES
(
tv
));
error
(
"type's TYPE_VALUES"
);
debug_tree
(
TYPE_VALUES
(
t
));
return
false
;
}
else
if
(
TREE_CODE
(
t
)
==
ARRAY_TYPE
&&
TYPE_DOMAIN
(
t
)
!=
TYPE_DOMAIN
(
tv
))
{
error
(
"type variant has different TYPE_DOMAIN"
);
debug_tree
(
tv
);
error
(
"type variant's TYPE_DOMAIN"
);
debug_tree
(
TYPE_DOMAIN
(
tv
));
error
(
"type's TYPE_DOMAIN"
);
debug_tree
(
TYPE_DOMAIN
(
t
));
return
false
;
}
/* Permit incomplete variants of complete type. While FEs may complete
all variants, this does not happen for C++ templates in all cases. */
else
if
(
RECORD_OR_UNION_TYPE_P
(
t
)
&&
COMPLETE_TYPE_P
(
t
)
&&
TYPE_FIELDS
(
t
)
!=
TYPE_FIELDS
(
tv
))
{
tree
f1
,
f2
;
/* Fortran builds qualified variants as new records with items of
qualified type. Verify that they looks same. */
for
(
f1
=
TYPE_FIELDS
(
t
),
f2
=
TYPE_FIELDS
(
tv
);
f1
&&
f2
;
f1
=
TREE_CHAIN
(
f1
),
f2
=
TREE_CHAIN
(
f2
))
if
(
TREE_CODE
(
f1
)
!=
FIELD_DECL
||
TREE_CODE
(
f2
)
!=
FIELD_DECL
||
(
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
f1
))
!=
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
f2
))
/* FIXME: gfc_nonrestricted_type builds all types as variants
with exception of pointer types. It deeply copies the type
which means that we may end up with a variant type
referring non-variant pointer. We may change it to
produce types as variants, too, like
objc_get_protocol_qualified_type does. */
&&
!
POINTER_TYPE_P
(
TREE_TYPE
(
f1
)))
||
DECL_FIELD_OFFSET
(
f1
)
!=
DECL_FIELD_OFFSET
(
f2
)
||
DECL_FIELD_BIT_OFFSET
(
f1
)
!=
DECL_FIELD_BIT_OFFSET
(
f2
))
break
;
if
(
f1
||
f2
)
{
error
(
"type variant has different TYPE_FIELDS"
);
debug_tree
(
tv
);
error
(
"first mismatch is field"
);
debug_tree
(
f1
);
error
(
"and field"
);
debug_tree
(
f2
);
return
false
;
}
}
else
if
((
TREE_CODE
(
t
)
==
FUNCTION_TYPE
||
TREE_CODE
(
t
)
==
METHOD_TYPE
)
&&
TYPE_ARG_TYPES
(
t
)
!=
TYPE_ARG_TYPES
(
tv
))
{
error
(
"type variant has different TYPE_ARG_TYPES"
);
debug_tree
(
tv
);
return
false
;
}
/* For C++ the qualified variant of array type is really an array type
of qualified TREE_TYPE.
objc builds variants of pointer where pointer to type is a variant, too
in objc_get_protocol_qualified_type. */
if
(
TREE_TYPE
(
t
)
!=
TREE_TYPE
(
tv
)
&&
((
TREE_CODE
(
t
)
!=
ARRAY_TYPE
&&
!
POINTER_TYPE_P
(
t
))
||
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
t
))
!=
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
tv
))))
{
error
(
"type variant has different TREE_TYPE"
);
debug_tree
(
tv
);
error
(
"type variant's TREE_TYPE"
);
debug_tree
(
TREE_TYPE
(
tv
));
error
(
"type's TREE_TYPE"
);
debug_tree
(
TREE_TYPE
(
t
));
return
false
;
}
if
(
TYPE_PRECISION
(
t
)
!=
TYPE_PRECISION
(
tv
))
{
error
(
"type variant has different TYPE_PRECISION"
);
debug_tree
(
tv
);
return
false
;
}
return
true
;
}
...
...
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