public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: -fprofile-update=atomic vs. 32-bit architectures
Date: Wed, 7 Dec 2022 10:09:51 +0100	[thread overview]
Message-ID: <CAFiYyc091GDJc_3sJ1dWoHSFg3eLA2RCkhGBiLzTR4ncVHQ2iA@mail.gmail.com> (raw)
In-Reply-To: <9257acd3-b9e7-3f6d-b950-fff68ece58a3@embedded-brains.de>

On Wed, Dec 7, 2022 at 9:51 AM Sebastian Huber
<sebastian.huber@embedded-brains.de> wrote:
>
> On 06.12.22 17:08, Richard Biener wrote:
> > Likely.  I'd use the gimple_build () API from gimple-fold.h which
> > builds the expression(s) to a gimple_seq creating necessary temporaries
> > on-the-fly and then insert that sequence on the edge.
>
> Thanks, I will have a look at this.
>
> I am struggling to convert a uint32_type_node node to a gcov_type_node
> (64-bit). I tried to use this:
>
>        if (result != NULL_TREE)
>         {
>            tree tmp1 = make_temp_ssa_name (gcov_type_node, NULL, name);
>           gassign *stmt7 = gimple_build_assign (result, VIEW_CONVERT_EXPR,
> build1 (VIEW_CONVERT_EXPR, gcov_type_node,
>                                            high));

You want

  gimple_build_assign (result, NOP_EXPR, high);

here (a conversion, from unsigned it will zero-extend)


>            tree tmp2 = make_temp_ssa_name (gcov_type_node, NULL, name);
>           gassign *stmt8 = gimple_build_assign (tmp2, LSHIFT_EXPR, tmp1,
> build_int_cst (integer_type_node, 32));
>           gassign *stmt9 = gimple_build_assign (result, BIT_IOR_EXPR, tmp2, tmp1);
>           gsi_insert_after (gsi, stmt7, GSI_NEW_STMT);
>           gsi_insert_after (gsi, stmt8, GSI_NEW_STMT);
>           gsi_insert_after (gsi, stmt9, GSI_NEW_STMT);
>         }
>
> This ends up in:
>
> ../test.c: In function 'f':
> ../test.c:4:1: error: conversion of register to a different size in
> 'view_convert_expr'
>      4 | }
>        | ^
> VIEW_CONVERT_EXPR<long long int>(PROF_time_profiler_15);
>
> PROF_time_profile_9 = VIEW_CONVERT_EXPR<long long
> int>(PROF_time_profiler_15);
> during IPA pass: profile
> ../test.c:4:1: internal compiler error: verify_gimple failed
> 0xdddc95 verify_gimple_in_cfg(function*, bool, bool)
>          /home/EB/sebastian_h/src/gcc/gcc/tree-cfg.cc:5647
> 0xc20221 execute_function_todo
>          /home/EB/sebastian_h/src/gcc/gcc/passes.cc:2091
> 0xc1efd6 do_per_function
>          /home/EB/sebastian_h/src/gcc/gcc/passes.cc:1701
> 0xc20416 execute_todo
>          /home/EB/sebastian_h/src/gcc/gcc/passes.cc:2145
> Please submit a full bug report, with preprocessed source (by using
> -freport-bug).
> Please include the complete backtrace with any bug report.
> See <https://gcc.gnu.org/bugs/> for instructions.
>
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/

  reply	other threads:[~2022-12-07  9:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  8:27 Sebastian Huber
2022-11-04  9:53 ` Gabriel Paubert
2022-11-04 10:02   ` Sebastian Huber
2022-11-05 11:18 ` Richard Biener
2022-11-08  6:22   ` Sebastian Huber
2022-11-08 10:25     ` Richard Biener
2022-11-08 12:00       ` Sebastian Huber
2022-11-08 13:52         ` Richard Biener
2022-12-05  7:26       ` Sebastian Huber
2022-12-05  7:44         ` Richard Biener
2022-12-06 13:11           ` Sebastian Huber
2022-12-06 16:08             ` Richard Biener
2022-12-07  8:51               ` Sebastian Huber
2022-12-07  9:09                 ` Richard Biener [this message]
2022-12-07  9:24                   ` Sebastian Huber
2022-12-07 11:49                     ` Richard Biener
2022-12-07  9:55 ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc091GDJc_3sJ1dWoHSFg3eLA2RCkhGBiLzTR4ncVHQ2iA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=sebastian.huber@embedded-brains.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).