From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0B31E385840F for ; Thu, 2 Dec 2021 14:04:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B31E385840F Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-99-NVwbHW5TO6KZTsM9rYNNpQ-1; Thu, 02 Dec 2021 09:04:13 -0500 X-MC-Unique: NVwbHW5TO6KZTsM9rYNNpQ-1 Received: by mail-qt1-f197.google.com with SMTP id y25-20020ac87059000000b002a71d24c242so36737470qtm.0 for ; Thu, 02 Dec 2021 06:04:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=GFfVkTI74CM6QiCJLSAmFw294pjX2hZoOLmwh5GWK+o=; b=gL85fgWU4mP9MJBMJFikeY0qF1wDGCjF2cmI05xy/x3/osXhfKE8v61wr9wE28p+Kr vGi88cjXIYJBO/Sr2Kx1Bh0eB89p8hQmszMiFWmzrrJChDzpk453Rmpqe9MNKjY/X4S3 yO9TeZm9jGYIY23j3QNZy0L+b7grnlL/jkYgrwwvjYwsHuqLnYtlnZk0e1jsTHEyX+kq c+vKSS6myl65TvQzNHOJx2fbQK5vJl9I3tHEttmuj76toM9EZ3PlVh1CnDGTcySjcCV2 tO8qUkvxvS1AQPfdj8fwmvJeQzdNhRmj5vvwYecMsX6reQQ4F/2kWjyYcHfzEjL3LPgo QzIA== X-Gm-Message-State: AOAM5325aEYQXzi13tET7WdexItyeMUY5WVHvS/66hLSZocE17DK+5kY SYcTTIKVjcFa/22tJhGp65K90VsNKULSFqxZ9UD/IR36icT47qck1dqv0PC0n8yJukNr19ie6ud rsRs8yTg= X-Received: by 2002:a05:622a:1114:: with SMTP id e20mr14105098qty.279.1638453852520; Thu, 02 Dec 2021 06:04:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPF9dJKPGgyK7Bn0AJFD/YWMpeZgoO625TkcYpH/Xy7PAss6l0jI+AEJSdWw7jIz3UXYCRIg== X-Received: by 2002:a05:622a:1114:: with SMTP id e20mr14105064qty.279.1638453852219; Thu, 02 Dec 2021 06:04:12 -0800 (PST) Received: from t14s.localdomain (c-73-69-212-193.hsd1.ma.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id d19sm1711956qtb.47.2021.12.02.06.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 06:04:11 -0800 (PST) Message-ID: <332033ff89dcde61932adacd4d509cded5728bd2.camel@redhat.com> Subject: Re: odd internal failure From: David Malcolm To: Richard Biener , Gary Oblock Cc: "gcc@gcc.gnu.org" Date: Thu, 02 Dec 2021 09:04:10 -0500 In-Reply-To: References: User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2021 14:04:17 -0000 On Thu, 2021-12-02 at 12:40 +0100, Richard Biener via Gcc wrote: > On Wed, Dec 1, 2021 at 9:56 PM Gary Oblock > wrote: > > > > Richard, > > > > I rebuilt at "-O0" and that particular call now works but on a call > > to > > the same function with a different offset it fails. 😱 > > use a debugger to see why In case you haven't seen them, I put together some tips on debugging GCC here: https://dmalcolm.fedorapeople.org/gcc/newbies-guide/debugging.html https://github.com/davidmalcolm/gcc-newbies-guide/blob/master/debugging.rst Inserting print statements only gets you so far; at some point you really need a debugger. Dave > > > Thanks, > > > > Gary > > > > > > ________________________________ > > From: Richard Biener > > Sent: Wednesday, December 1, 2021 1:09 AM > > To: Gary Oblock > > Cc: gcc@gcc.gnu.org  > > Subject: Re: odd internal failure > > > > [EXTERNAL EMAIL NOTICE: This email originated from an external > > sender. Please be mindful of safe email handling and proprietary > > information protection practices.] > > > > > > On Wed, Dec 1, 2021 at 8:46 AM Gary Oblock via Gcc > > wrote: > > > > > > What is happening should be trivial to determine but for some > > > reason it's > > > not. I'd normally bounce this off a coworker but given the pandemic > > > and modern dispersed hiring practices it's not even remotely > > > possible. > > > > > > I'm making this call and tree_to_uhwi is failing on an internal > > > error. > > > That's normally easy to fix, but here is where the weirdness kicks > > > in. > > > > > >   unsigned HOST_WIDE_INT wi_offset = tree_to_uhwi (offset); > > > > > > tree_to_uhwi from tree.h is: > > > > > > extern inline __attribute__ ((__gnu_inline__)) unsigned > > > HOST_WIDE_INT > > > tree_to_uhwi (const_tree t) > > > { > > >   gcc_assert (tree_fits_uhwi_p (t)); > > >   return TREE_INT_CST_LOW (t); > > > } > > > > > > and > > > > > > tree_fits_uhwi_p from tree.c is > > > > > > bool > > > tree_fits_uhwi_p (const_tree t) > > > { > > >   return (t != NULL_TREE > > >  && TREE_CODE (t) == INTEGER_CST > > >  && wi::fits_uhwi_p (wi::to_widest (t))); > > > } > > > > > > Here's what this instrumentation shows (DEBUG_A is an indenting > > > fprintf to > > > stderr.) > > > > > >   DEBUG_A ("TREE_CODE(offset) = %s  && ", code_str (TREE_CODE > > > (offset))); > > >   DEBUG_A ("fits %s\n", wi::fits_uhwi_p (wi::to_widest (offset)) ? > > > "true" : "false"); > > >   DEBUG_A ("tree_fits_uhwi_p(offset) %s\n",tree_fits_uhwi_p > > > (offset) ? "true" : "false"); > > > > > >            TREE_CODE(offset) = INTEGER_CST  && fits true > > >            tree_fits_uhwi_p(offset) true > > > > > > By the way, offset is: > > > > > > _Literal (struct BASKET * *) 8 > > > > > > And it's an operand of: > > > > > > MEM[(struct BASKET * *)&perm + 8B] > > > > > > Any clues on what's going on here? > > > > it should just work. > > > > > Thanks, > > > > > > Gary > > > > > > > Btw, try to setup things so you don't spam below stuff to public > > mailing lists. > > > > > CONFIDENTIALITY NOTICE: This e-mail message, including any > > > attachments, is for the sole use of the intended recipient(s) and > > > contains information that is confidential and proprietary to Ampere > > > Computing or its subsidiaries. It is to be used solely for the > > > purpose of furthering the parties' business relationship. Any > > > unauthorized review, copying, or distribution of this email (or any > > > attachments thereto) is strictly prohibited. If you are not the > > > intended recipient, please contact the sender immediately and > > > permanently delete the original and any copies of this email and > > > any attachments thereto. >