* [PATCH] GCC LTO-bootstrap -Wodr fix
@ 2015-02-26 14:25 Martin Liška
2015-02-26 15:21 ` Tobias Burnus
0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2015-02-26 14:25 UTC (permalink / raw)
To: GCC Patches
[-- Attachment #1: Type: text/plain, Size: 608 bytes --]
Hello.
Following error message can be seen for LTO boostrap:
../../gcc/fortran/resolve.c:3812:1: error: type âcomparisonâ violates one definition rule [-Werror=odr]
comparison;
^
../../gcc/compare-elim.c:95:0: note: a different type is defined in another translation unit
rtx_insn *insn;
^
lto1: all warnings being treated as errors
lto-wrapper: fatal error: /home/marxin/Programming/gcc3/objdir/./prev-gcc/xg++ returned 1 exit status
I've removed enum type in resolve.c, which is quite small change (I hope so).
With patch applied, GCC can bootstrap.
Ready for trunk?
Thanks,
Martin
[-- Attachment #2: 0001-Fix-LTO-bootstrap.patch --]
[-- Type: text/x-patch, Size: 1725 bytes --]
From 248d92eb9d9131d0643eb32bce273444bf1ac968 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Thu, 26 Feb 2015 13:23:38 +0100
Subject: [PATCH] Fix LTO bootstrap.
gcc/fortran/ChangeLog:
2015-02-26 Martin Liska <mliska@suse.cz>
* resolve.c: Rename enum 'comparison' to 'compare_result' as
solution for -Wodr issue.
---
gcc/fortran/resolve.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index b1111cc..675cb15 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -3809,11 +3809,11 @@ bad_op:
typedef enum
{ CMP_LT, CMP_EQ, CMP_GT, CMP_UNKNOWN }
-comparison;
+compare_result;
/* Compare two integer expressions. */
-static comparison
+static compare_result
compare_bound (gfc_expr *a, gfc_expr *b)
{
int i;
@@ -3840,7 +3840,7 @@ compare_bound (gfc_expr *a, gfc_expr *b)
/* Compare an integer expression with an integer. */
-static comparison
+static compare_result
compare_bound_int (gfc_expr *a, int b)
{
int i;
@@ -3863,7 +3863,7 @@ compare_bound_int (gfc_expr *a, int b)
/* Compare an integer expression with a mpz_t. */
-static comparison
+static compare_result
compare_bound_mpz_t (gfc_expr *a, mpz_t b)
{
int i;
@@ -4002,7 +4002,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
#define AR_START (ar->start[i] ? ar->start[i] : as->lower[i])
#define AR_END (ar->end[i] ? ar->end[i] : as->upper[i])
- comparison comp_start_end = compare_bound (AR_START, AR_END);
+ compare_result comp_start_end = compare_bound (AR_START, AR_END);
/* Check for zero stride, which is not allowed. */
if (compare_bound_int (ar->stride[i], 0) == CMP_EQ)
--
2.1.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] GCC LTO-bootstrap -Wodr fix
2015-02-26 14:25 [PATCH] GCC LTO-bootstrap -Wodr fix Martin Liška
@ 2015-02-26 15:21 ` Tobias Burnus
0 siblings, 0 replies; 2+ messages in thread
From: Tobias Burnus @ 2015-02-26 15:21 UTC (permalink / raw)
To: Martin Liska, gcc-patches, fortran
Martin Liska wrote:
> Following error message can be seen for LTO boostrap:
> ../../gcc/fortran/resolve.c:3812:1: error: type âcomparisonâ violates one definition rule [-Werror=odr]
> comparison;
> ^
>../../gcc/compare-elim.c:95:0: note: a different type is defined in another translation unit
> rtx_insn *insn;
> I've removed enum type in resolve.c, which is quite small change (I hope so).
> With patch applied, GCC can bootstrap.
> Ready for trunk?
> gcc/fortran/ChangeLog:
>
> 2015-02-26 Martin Liska <mliska@suse.cz>
>
> * resolve.c: Rename enum 'comparison' to 'compare_result' as
> solution for -Wodr issue.
OK. Thanks for the patch!
Tobias
PS: For Fortran patches, it helps to have fortran@ CCed as not all developers
also read gcc-patches@.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-26 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-26 14:25 [PATCH] GCC LTO-bootstrap -Wodr fix Martin Liška
2015-02-26 15:21 ` Tobias Burnus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).