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
c9fc06dc
Commit
c9fc06dc
authored
Jun 21, 2011
by
Christian Bruel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR middle-end/49139 fix always_inline diagnostics
From-SVN: r175239
parent
f1ee724c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
50 additions
and
32 deletions
+50
-32
gcc/cgraphunit.c
+8
-0
gcc/ipa-inline-transform.c
+7
-11
gcc/testsuite/g++.dg/ipa/devirt-7.C
+1
-1
gcc/testsuite/gcc.dg/20051201-1.c
+1
-1
gcc/testsuite/gcc.dg/always_inline.c
+2
-2
gcc/testsuite/gcc.dg/always_inline2.c
+3
-3
gcc/testsuite/gcc.dg/always_inline3.c
+3
-3
gcc/testsuite/gcc.dg/debug/pr41264-1.c
+1
-0
gcc/testsuite/gcc.dg/fail_always_inline.c
+11
-0
gcc/testsuite/gcc.dg/inline-22.c
+1
-1
gcc/testsuite/gcc.dg/lto/20090218-1_0.c
+1
-1
gcc/testsuite/gcc.dg/lto/20090218-1_1.c
+1
-1
gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
+1
-1
gcc/testsuite/gcc.dg/uninit-pred-5_a.c
+1
-1
gcc/testsuite/gcc.dg/uninit-pred-5_b.c
+1
-1
gcc/tree-inline.c
+7
-5
No files found.
gcc/cgraphunit.c
View file @
c9fc06dc
...
...
@@ -986,6 +986,14 @@ process_function_and_variable_attributes (struct cgraph_node *first,
DECL_ATTRIBUTES
(
decl
)
=
remove_attribute
(
"weakref"
,
DECL_ATTRIBUTES
(
decl
));
}
if
(
lookup_attribute
(
"always_inline"
,
DECL_ATTRIBUTES
(
decl
))
&&
!
DECL_DECLARED_INLINE_P
(
decl
)
/* redefining extern inline function makes it DECL_UNINLINABLE. */
&&
!
DECL_UNINLINABLE
(
decl
))
warning_at
(
DECL_SOURCE_LOCATION
(
decl
),
OPT_Wattributes
,
"always_inline function might not be inlinable"
);
process_common_attributes
(
decl
);
}
for
(
vnode
=
varpool_nodes
;
vnode
!=
first_var
;
vnode
=
vnode
->
next
)
...
...
gcc/ipa-inline-transform.c
View file @
c9fc06dc
...
...
@@ -348,8 +348,7 @@ inline_transform (struct cgraph_node *node)
{
unsigned
int
todo
=
0
;
struct
cgraph_edge
*
e
;
bool
inline_p
=
false
;
/* FIXME: Currently the pass manager is adding inline transform more than
once to some clones. This needs revisiting after WPA cleanups. */
if
(
cfun
->
after_inlining
)
...
...
@@ -361,20 +360,17 @@ inline_transform (struct cgraph_node *node)
save_inline_function_body
(
node
);
for
(
e
=
node
->
callees
;
e
;
e
=
e
->
next_callee
)
cgraph_redirect_edge_call_stmt_to_callee
(
e
);
timevar_push
(
TV_INTEGRATION
);
if
(
node
->
callees
)
{
cgraph_redirect_edge_call_stmt_to_callee
(
e
);
if
(
!
e
->
inline_failed
||
warn_inline
)
inline_p
=
true
;
/* Redirecting edges might lead to a need for vops to be recomputed. */
todo
|=
TODO_update_ssa_only_virtuals
;
}
if
(
inline_p
)
{
timevar_push
(
TV_INTEGRATION
);
todo
=
optimize_inline_calls
(
current_function_decl
);
timevar_pop
(
TV_INTEGRATION
);
}
timevar_pop
(
TV_INTEGRATION
);
cfun
->
always_inline_functions_inlined
=
true
;
cfun
->
after_inlining
=
true
;
return
todo
|
execute_fixup_cfg
();
...
...
gcc/testsuite/g++.dg/ipa/devirt-7.C
View file @
c9fc06dc
...
...
@@ -56,7 +56,7 @@ int __attribute__ ((noinline,noclone)) get_input(void)
return
1
;
}
int
__attribute__
((
always_inline
))
int
inline
__attribute__
((
always_inline
))
A
::
middleman_1
(
int
i
)
{
return
this
->
foo
(
i
);
...
...
gcc/testsuite/gcc.dg/20051201-1.c
View file @
c9fc06dc
...
...
@@ -2,7 +2,7 @@
tree_flow_call_edges_add. */
/* { dg-do compile } */
/* { dg-options "-O1 -fprofile-generate" } */
/* { dg-options "-O1 -fprofile-generate
-Wno-attributes
" } */
static
__attribute__
((
always_inline
))
void
baz
()
...
...
gcc/testsuite/gcc.dg/always_inline.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-
Winline -
O2" } */
/* { dg-options "-O2" } */
#include <stdarg.h>
inline
__attribute__
((
always_inline
))
void
e
(
int
t
,
...)
/* { dg-
message "sorry\[^\n\]*variable argument" "
" } */
e
(
int
t
,
...)
/* { dg-
error "variable argument lists
" } */
{
va_list
q
;
va_start
(
q
,
t
);
...
...
gcc/testsuite/gcc.dg/always_inline2.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-
Winline -
O2" } */
inline
__attribute__
((
always_inline
))
void
t
(
void
);
/* { dg-
message "sorry\[^\n\]*body not available" "
" } */
/* { dg-options "-O2" } */
inline
__attribute__
((
always_inline
))
void
t
(
void
);
/* { dg-
error "body not available
" } */
void
q
(
void
)
{
t
();
/* { dg-
message "sorry\[^\n\]*called from here" "
" } */
t
();
/* { dg-
error "called from here
" } */
}
gcc/testsuite/gcc.dg/always_inline3.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-
Winline -
O2" } */
/* { dg-options "-O2" } */
int
do_something_evil
(
void
);
inline
__attribute__
((
always_inline
))
void
q2
(
void
)
/* { dg-
message "sorry\[^\n\]*recursive" "
" } */
q2
(
void
)
/* { dg-
error "recursive inlining
" } */
{
if
(
do_something_evil
())
return
;
q2
();
/* { dg-
message "sorry\[^\n\]*called from here" "
" } */
q2
();
/* { dg-
error "called from here
" } */
q2
();
/* With -O2 we don't warn here, it is eliminated by tail recursion. */
}
gcc/testsuite/gcc.dg/debug/pr41264-1.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-Wno-attributes" } */
#if (__SIZEOF_INT__ <= 2)
typedef
unsigned
long
hashval_t
;
...
...
gcc/testsuite/gcc.dg/fail_always_inline.c
0 → 100644
View file @
c9fc06dc
/* { dg-do compile } */
extern
__attribute__
((
always_inline
))
void
bar
()
{
}
/* { dg-warning "function might not be inlinable" } */
void
f
()
{
bar
();
}
gcc/testsuite/gcc.dg/inline-22.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-funit-at-a-time" } */
/* { dg-options "-funit-at-a-time
-Wno-attributes
" } */
/* Verify we can inline without a complete prototype and with promoted
arguments. See also PR32492. */
__attribute__
((
always_inline
))
void
f1
()
{}
...
...
gcc/testsuite/gcc.dg/lto/20090218-1_0.c
View file @
c9fc06dc
void
set_mem_alias_set
()
__attribute__
((
always_inline
));
void
inline
set_mem_alias_set
()
__attribute__
((
always_inline
));
void
emit_push_insn
()
{
set_mem_alias_set
();
}
gcc/testsuite/gcc.dg/lto/20090218-1_1.c
View file @
c9fc06dc
...
...
@@ -4,6 +4,6 @@ int main(void)
}
static
void
__attribute__
((
noinline
))
get_mem_attrs
()
{
}
void
__attribute__
((
always_inline
))
set_mem_alias_set
()
{
void
inline
__attribute__
((
always_inline
))
set_mem_alias_set
()
{
get_mem_attrs
();
}
gcc/testsuite/gcc.dg/torture/pta-structcopy-1.c
View file @
c9fc06dc
/* { dg-do run } */
/* { dg-options "-fdump-tree-ealias" } */
/* { dg-options "-fdump-tree-ealias
-Wno-attributes
" } */
/* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
struct
X
...
...
gcc/testsuite/gcc.dg/uninit-pred-5_a.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -O2" } */
/* { dg-options "-Wuninitialized -
Wno-attributes -
O2" } */
int
g
;
int
bar
();
...
...
gcc/testsuite/gcc.dg/uninit-pred-5_b.c
View file @
c9fc06dc
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -O2" } */
/* { dg-options "-Wuninitialized -
Wno-attributes -
O2" } */
int
g
;
int
bar
();
...
...
gcc/tree-inline.c
View file @
c9fc06dc
...
...
@@ -3192,7 +3192,7 @@ tree_inlinable_function_p (tree fn)
As a bonus we can now give more details about the reason why a
function is not inlinable. */
if
(
always_inline
)
sorry
(
inline_forbidden_reason
,
fn
);
error
(
inline_forbidden_reason
,
fn
);
else
if
(
do_warning
)
warning
(
OPT_Winline
,
inline_forbidden_reason
,
fn
);
...
...
@@ -3742,11 +3742,13 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
if
(
lookup_attribute
(
"always_inline"
,
DECL_ATTRIBUTES
(
fn
))
/* Avoid warnings during early inline pass. */
&&
cgraph_global_info_ready
)
&&
cgraph_global_info_ready
/* PR 20090218-1_0.c. Body can be provided by another module. */
&&
(
reason
!=
CIF_BODY_NOT_AVAILABLE
||
!
flag_generate_lto
))
{
sorry
(
"inlining failed in call to
%q+F: %s"
,
fn
,
_
(
cgraph_inline_failed_string
(
reason
)
));
sorry
(
"called from here"
);
error
(
"inlining failed in call to always_inline
%q+F: %s"
,
fn
,
cgraph_inline_failed_string
(
reason
));
error
(
"called from here"
);
}
else
if
(
warn_inline
&&
DECL_DECLARED_INLINE_P
(
fn
)
...
...
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