public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/105053] Wrong loop count for scalar code from vectorizer
Date: Fri, 25 Mar 2022 12:29:23 +0000	[thread overview]
Message-ID: <bug-105053-4-RDkhreHjq5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105053-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105053

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> (In reply to Richard Biener from comment #1)
> > It also reproduces with n == 16 for me - can you produce a testcase with a
> > static initializer that's known to fail please?
> 
> And n == 4, but std::cout << vec; doesn't like me :P

1597201307 1817606674
1380347796 1721941769
837975613 1032707773
1173654292 2020064272

Testcase:

#include <vector>
#include <tuple>
#include <algorithm>

int main()
{
  const int n = 4;
  std::vector<std::tuple<int,int,double>> vec
      = { { 1597201307, 1817606674, 0. },
            { 1380347796, 1721941769, 0.},
            {837975613, 1032707773, 0.},
            {1173654292, 2020064272, 0.} } ;
  int sup1 = 0;
  for(int i=0;i<n;++i)
    sup1=std::max(sup1,std::max(std::get<0>(vec[i]),std::get<1>(vec[i])));
  int sup2 = 0;
  for(int i=0;i<n;++i)
    sup2=std::max(std::max(sup2,std::get<0>(vec[i])),std::get<1>(vec[i]));
  if (sup1 != sup2)
    std::abort ();
  return 0;
}

  parent reply	other threads:[~2022-03-25 12:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 10:51 [Bug tree-optimization/105053] New: " glisse at gcc dot gnu.org
2022-03-25 11:28 ` [Bug tree-optimization/105053] " rguenth at gcc dot gnu.org
2022-03-25 11:31 ` rguenth at gcc dot gnu.org
2022-03-25 12:29 ` rguenth at gcc dot gnu.org [this message]
2022-03-25 12:48 ` rguenth at gcc dot gnu.org
2022-03-25 13:29 ` rguenth at gcc dot gnu.org
2022-03-25 14:26 ` cvs-commit at gcc dot gnu.org
2022-03-25 14:27 ` rguenth at gcc dot gnu.org
2022-03-25 16:33 ` glisse at gcc dot gnu.org
2022-03-25 16:37 ` marxin at gcc dot gnu.org
2022-03-28  6:32 ` [Bug tree-optimization/105053] [11 Regression] " rguenth at gcc dot gnu.org
2022-04-07  9:53 ` cvs-commit at gcc dot gnu.org
2022-04-07  9:55 ` rguenth at gcc dot gnu.org

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=bug-105053-4-RDkhreHjq5@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).