public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/103676] internal compiler error: in extract_constrain_insn, at recog.c:2671
Date: Tue, 14 Dec 2021 01:48:34 +0000	[thread overview]
Message-ID: <bug-103676-4-Q9CGrJFbPm@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103676-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|1                           |0
             Status|WAITING                     |UNCONFIRMED

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Semi-reduced testcase (single file):
typedef unsigned long long uint64_t;
typedef uint64_t uint_fast64_t;
uint64_t timer_monotonic_coarse();
struct list {
 struct list *next;
 struct list *prev;
};

static inline list *
list_insert(list *prev, list *node)
{

 node->next = prev->next;
 node->prev = prev;
 prev->next->prev = node;
 prev->next = node;
 return node;
}




static inline list *
list_remove(list *node)
{
 node->prev->next = node->next;
 node->next->prev = node->prev;
 return node;
}

struct timer {
 list link;
 int active;
 uint_fast64_t expire;
 uint_fast64_t interval;
 void (*func)(void *);
 void *arg;
};
int irq_disable();
void irq_restore(int);
template<class T> struct atomic { T a; };
__attribute__((section(".fast_bss"))) atomic<uint64_t> monotonic;

extern "C" uint64_t
__atomic_load_8(const volatile void *p, int m)
{

 const volatile uint64_t *p64 = static_cast<const volatile uint64_t *>(p);
 uint64_t tmp;
 asm volatile(
  "ldrd %Q[r], %R[r], %[p]\n"
  : [r]"=lh"(tmp)
  : [p]"m"(*p64)
  : "memory"
 );
 return tmp;
}


uint_fast64_t
timer_monotonic_coarse()
{
 return __atomic_load_n(&monotonic.a, 0);
}

void
timer_callout(timer *tmr, uint_fast64_t nsec, uint_fast64_t interval,
       void (*func)(void *), void *arg)
{

 const uint_fast64_t period = 1000000000 / 1000;

 const int s = irq_disable();
 if (tmr->active)
  list_remove(&tmr->link);
 tmr->func = func;
 tmr->arg = arg;
 tmr->active = 1;
 tmr->interval = interval;



 tmr->expire = timer_monotonic_coarse() + period + (nsec == 1 ? 0 : nsec);
 //timer_insert(tmr);
 irq_restore(s);
}

----- CUT ----
Compile with -mcpu=cortex-m7 -mthumb -g -pipe -Wall -O2 -Wframe-larger-than=384
-fno-pie  -masm-syntax-unified -mslow-flash-data -Wframe-larger-than=384
-Wundef -fno-pie  -masm-syntax-unified -mslow-flash-data -nostdinc++
-fno-exceptions -std=gnu++20 -DKERNEL -D_GNU_SOURCE  -fuse-linker-plugin
-fno-use-cxa-atexit  -mfloat-abi=soft

  parent reply	other threads:[~2021-12-14  1:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 22:32 [Bug target/103676] New: " patrick.oppenlander at gmail dot com
2021-12-12 23:31 ` [Bug target/103676] " pinskia at gcc dot gnu.org
2021-12-12 23:32 ` pinskia at gcc dot gnu.org
2021-12-12 23:54 ` patrick.oppenlander at gmail dot com
2021-12-12 23:58 ` patrick.oppenlander at gmail dot com
2021-12-13 22:56 ` patrick.oppenlander at gmail dot com
2021-12-13 23:06 ` pinskia at gcc dot gnu.org
2021-12-13 23:13 ` pinskia at gcc dot gnu.org
2021-12-14  0:48 ` patrick.oppenlander at gmail dot com
2021-12-14  0:48 ` patrick.oppenlander at gmail dot com
2021-12-14  0:51 ` pinskia at gcc dot gnu.org
2021-12-14  0:52 ` pinskia at gcc dot gnu.org
2021-12-14  1:16 ` patrick.oppenlander at gmail dot com
2021-12-14  1:17 ` patrick.oppenlander at gmail dot com
2021-12-14  1:48 ` pinskia at gcc dot gnu.org [this message]
2021-12-14  1:50 ` [Bug target/103676] [10/11/12 Regression] " pinskia at gcc dot gnu.org
2021-12-14  2:07 ` pinskia at gcc dot gnu.org
2021-12-14  2:11 ` pinskia at gcc dot gnu.org
2021-12-14  2:15 ` pinskia at gcc dot gnu.org
2021-12-29 17:02 ` jakub at gcc dot gnu.org
2021-12-29 17:06 ` jakub at gcc dot gnu.org
2022-01-17 12:46 ` rguenth at gcc dot gnu.org
2022-01-17 16:43 ` vmakarov at gcc dot gnu.org
2022-01-17 17:00 ` jakub at gcc dot gnu.org
2022-01-18 13:38 ` vmakarov at gcc dot gnu.org
2022-01-21 18:37 ` cvs-commit at gcc dot gnu.org
2022-01-28 16:38 ` [Bug target/103676] [10/11 " jakub at gcc dot gnu.org
2022-06-28 10:47 ` jakub at gcc dot gnu.org
2023-07-07 10:41 ` [Bug target/103676] [11 " 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-103676-4-Q9CGrJFbPm@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).