[Bug bootstrap/62005] [4.10 regression] with --enable-checking=rtl : loop-unroll.c:2095:10: error: function may return address of local variable

2014-08-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62005

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Jakub Jelinek jakub at gcc dot gnu.org ---
Author: jakub
Date: Tue Aug  5 08:09:00 2014
New Revision: 213621

URL: https://gcc.gnu.org/viewcvs?rev=213621root=gccview=rev
Log:
* loop-unroll.c (struct iv_to_split): Remove n_loc and loc fields.
(analyze_iv_to_split_insn): Don't initialize them.
(get_ivts_expr): Removed.
(allocate_basic_variable, insert_base_initialization): Use
SET_SRC instead of *get_ivts_expr.
(split_iv): Use SET_SRC instead of get_ivts_expr.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/loop-unroll.c


[Bug bootstrap/62005] [4.10 regression] with --enable-checking=rtl : loop-unroll.c:2095:10: error: function may return address of local variable

2014-08-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62005

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 CC||glisse at gcc dot gnu.org
   Target Milestone|--- |4.10.0

--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org ---
Hmm, the warning is true if ivts-n_loc == 0.  Marc?


[Bug bootstrap/62005] [4.10 regression] with --enable-checking=rtl : loop-unroll.c:2095:10: error: function may return address of local variable

2014-08-04 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62005

--- Comment #2 from Marc Glisse glisse at gcc dot gnu.org ---
Ah, I didn't test with --enable-ckecking=rtl.

We could split the maybe part of the warning and downgrade it to Wextra, but
I'd rather keep it at least in Wall, which means we need to change the
loop-unroll code anyway.

The code is not easy to understand. For instance, I don't see where n_loc can
be set to any value other than 1? That would make it easy to simplify this
loop...


[Bug bootstrap/62005] [4.10 regression] with --enable-checking=rtl : loop-unroll.c:2095:10: error: function may return address of local variable

2014-08-04 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62005

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org ---
I've posted a loop-unroll.c fix.

That said, an interesting question is why we don't warn about this without rtl
checking, the function still returns address of the parameter.  Is that because
it is inlined in that case and so we don't warn then?


[Bug bootstrap/62005] [4.10 regression] with --enable-checking=rtl : loop-unroll.c:2095:10: error: function may return address of local variable

2014-08-04 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62005

--- Comment #4 from Marc Glisse glisse at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #3)
 That said, an interesting question is why we don't warn about this without
 rtl checking, the function still returns address of the parameter.  Is that
 because it is inlined in that case and so we don't warn then?

That seems likely, RTL checking may make the function large enough not to be
inlined. Compiling without RTL checking but with -fkeep-inline-functions
probably warns as well then.


[Bug bootstrap/62005] [4.10 regression] with --enable-checking=rtl : loop-unroll.c:2095:10: error: function may return address of local variable

2014-08-04 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62005

--- Comment #5 from Marc Glisse glisse at gcc dot gnu.org ---
(In reply to Marc Glisse from comment #4)
 Compiling without RTL checking but with -fkeep-inline-functions
 probably warns as well then.

Uh, for some reason -fkeep-inline-functions does not preserve static functions,
but it does preserve static inline functions (so it warns if I add inline on
the definition of get_ivts_expr). I couldn't find a -fkeep-static-functions.