This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix 20090126-1_0 ICE (ICE in WHOPR combining -O0 to -O2 object)


On Tue, May 4, 2010 at 7:56 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> You should use inform () and dg-message.
>
> Hi,
> this patch adds the informs on missing summaries and solved the ICE.
> Unfortunately I can't seem to be able to make testsuite happy about the warning
> and I get
> WARNING: lto.exp does not support dg-message
> WARNING: lto.exp does not support dg-message
>
> Adding support for dg-message into LTO seems a bit out of my dejagnu-fu,
> especially because we get the warning at linktime, not compile time. ?Would
> anyone willing to help me here?

Maybe Janis can?  I suppose we'd need dg-link-message or so.

Comments below

> Thanks,
> Honza
>
> ? ? ? ?* ipa-prop.c: Include toplev.h
> ? ? ? ?(ipa_prop_read_jump_functions): Output warning
> ? ? ? ?on missing secitons.
> ? ? ? ?* ipa-pure-const.c (pure_const_read_summary): Likewise.
> ? ? ? ?* ipa-reference.c: Include toplev.h.
> ? ? ? ?(ipa_reference_read_summary): Output warnings.
> Index: ipa-prop.c
> ===================================================================
> --- ipa-prop.c ?(revision 159030)
> +++ ipa-prop.c ?(working copy)
> @@ -35,6 +35,7 @@ along with GCC; see the file COPYING3.
> ?#include "flags.h"
> ?#include "diagnostic.h"
> ?#include "lto-streamer.h"
> +#include "toplev.h"
>
> ?/* Vector where the parameter infos are actually stored. */
> ?VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
> @@ -2170,6 +2171,22 @@ ipa_prop_read_jump_functions (void)
>
> ? ? ? if (data)
> ? ? ? ? ipa_prop_read_section (file_data, data, len);
> + ? ? ?else
> + ? ? ? {
> + ? ? ? ? inform (input_location,
> + ? ? ? ? ? ? ? ? "File %s was compiled without jump functions",
> + ? ? ? ? ? ? ? ? ?file_data->file_name);

People will have no idea what jump-functions are about.  Maybe
just say

  "File %s was compiled without -fipa-cp"

Thanks,
Richard.

> + ? ? ? ? if (flag_ipa_cp)
> + ? ? ? ? ? {
> + ? ? ? ? ? ? inform (input_location, "Implying -fno-ipa-cp");
> + ? ? ? ? ? ? flag_ipa_cp = false;
> + ? ? ? ? ? }
> + ? ? ? ? if (flag_indirect_inlining)
> + ? ? ? ? ? {
> + ? ? ? ? ? ? inform (input_location, "Implying -fno-indirect-inlining");
> + ? ? ? ? ? ? flag_indirect_inlining = false;
> + ? ? ? ? ? }
> + ? ? ? }
> ? ? }
> ?}
>
> Index: ipa-pure-const.c
> ===================================================================
> --- ipa-pure-const.c ? ?(revision 159030)
> +++ ipa-pure-const.c ? ?(working copy)
> @@ -878,6 +878,24 @@ pure_const_read_summary (void)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LTO_section_ipa_pure_const,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ib, data, len);
> ? ? ? ?}
> + ? ? ?else
> + ? ? ? {
> + ? ? ? ? /* We did not find the summary in given file. ?Disable the
> + ? ? ? ? ? ?option and inform users.
> + ? ? ? ? ? ?We can be more sane here: with -flto we can compute missing
> + ? ? ? ? ? ?information. ?In WPA stage we can either assume conservative
> + ? ? ? ? ? ?values or simply read in the functions missing summaries and
> + ? ? ? ? ? ?analyze. ?But it is probably better to instruct users to not
> + ? ? ? ? ? ?combine -O0 and -O2 compilations and expect sane results. ?*/
> + ? ? ? ? inform (input_location,
> + ? ? ? ? ? ? ? ? "File %s was compiled without -fipa-pure-const",
> + ? ? ? ? ? ? ? ? ?file_data->file_name);
> + ? ? ? ? if (flag_ipa_pure_const)
> + ? ? ? ? ? {
> + ? ? ? ? ? ? inform (input_location, "Implying -fno-ipa-pure-const");
> + ? ? ? ? ? ? flag_ipa_pure_const = false;
> + ? ? ? ? ? }
> + ? ? ? }
> ? ? }
> ?}
>
> Index: ipa-reference.c
> ===================================================================
> --- ipa-reference.c ? ? (revision 159030)
> +++ ipa-reference.c ? ? (working copy)
> @@ -70,6 +70,7 @@ along with GCC; see the file COPYING3.
> ?#include "diagnostic.h"
> ?#include "langhooks.h"
> ?#include "lto-streamer.h"
> +#include "toplev.h"
>
> ?static void add_new_function (struct cgraph_node *node,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?void *data ATTRIBUTE_UNUSED);
> @@ -1172,6 +1173,24 @@ ipa_reference_read_summary (void)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?LTO_section_ipa_reference,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?ib, data, len);
> ? ? ? ?}
> + ? ? ?else
> + ? ? ? {
> + ? ? ? ? /* We did not find the summary in given file. ?Disable the
> + ? ? ? ? ? ?option and inform users.
> + ? ? ? ? ? ?We can be more sane here: with -flto we can compute missing
> + ? ? ? ? ? ?information. ?In WPA stage we can either assume conservative
> + ? ? ? ? ? ?values or simply read in the functions missing summaries and
> + ? ? ? ? ? ?analyze. ?But it is probably better to instruct users to not
> + ? ? ? ? ? ?combine -O0 and -O2 compilations and expect sane results. ?*/
> + ? ? ? ? inform (input_location,
> + ? ? ? ? ? ? ? ? "File %s was compiled without -fipa-reference",
> + ? ? ? ? ? ? ? ? ?file_data->file_name);
> + ? ? ? ? if (flag_ipa_reference)
> + ? ? ? ? ? {
> + ? ? ? ? ? ? inform (input_location, "Implying -fno-ipa-reference");
> + ? ? ? ? ? ? flag_ipa_reference = false;
> + ? ? ? ? ? }
> + ? ? ? }
> ? ? }
> ?}
>
> Index: testsuite/gcc.dg/lto/20090126-1_0.c
> ===================================================================
> --- testsuite/gcc.dg/lto/20090126-1_0.c (revision 159030)
> +++ testsuite/gcc.dg/lto/20090126-1_0.c (working copy)
> @@ -1,6 +1,8 @@
> ?/* { dg-lto-do link } */
> ?/* { dg-lto-options {{-O0 -fwhopr}} } */
> ?/* { dg-extra-ld-options {-r -nostdlib -O2 -fwhopr} } */
> +/* { dg-message "compiled without" "" {target "*-*-*"} 0 } */
> +/* { dg-message "Implying" "" {target "*-*-*"} 0 } */
>
> ?int main(int argc, char **argv) {
> ? return 0;
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]